AddInfo objects store a set of attributes. More...

#include "IAddInfo.hpp"

+ Inheritance diagram for IAddInfo:

Public Member Functions

virtual unsigned columns () const =0
virtual const char * name (unsigned index) const =0
virtual ColumnType::Type type (unsigned index) const =0
virtual ColumnSemantic::Type semantic (unsigned index) const =0
virtual unsigned size (unsigned index) const =0
 returns array size
virtual int index (const char *) const =0
virtual int index (ColumnSemantic::Type) const =0
virtual const IAddInfoLayoutlayout () const =0
virtual bool isView () const =0
 is the current layout just a view onto the storage object
virtual IAddInfoclone () const =0
 returns a full copy of the current object
virtual IAddInfocloneView (const AddInfoLayoutHandle &layout, bool readOnly) const =0
 creates a new addinfo object with the provide view layout that refers to the same storage object
virtual IAddInfocloneView (const AddInfoLayoutHandle &viewLayout, const AddInfoLayoutHandle &dataLayout) const =0
 creates a new addinfo object with the provide view layout and secures that the storage object contains the dataLayout
virtual IAddInfocloneFullLayout () const =0
 creates a new addinfo object using the true storage layout that referring to the same storage object
virtual void setView (const AddInfoLayoutHandle &layout, bool readOnly)=0
 applies a certain layout view onto the current object
virtual void restoreFullLayout ()=0
 removes any view layout and sets the true storage layout as (internal) layout
virtual bool isNull (unsigned index) const =0
virtual void setNull (unsigned index, bool nullFlag=true)=0
virtual void setInt (unsigned index, int)=0
virtual void setUInt (unsigned index, unsigned int)=0
virtual void setChar (unsigned index, char)=0
virtual void setUChar (unsigned index, unsigned char)=0
virtual void setShort (unsigned index, short)=0
virtual void setUShort (unsigned index, unsigned short)=0
virtual void setFloat (unsigned index, float)=0
virtual void setDouble (unsigned index, double)=0
virtual void setLLong (unsigned index, long long)=0
virtual void setCStr (unsigned index, const char *)=0
 for setting column values of type eCOLTYPE_CSTR or eCOLTYPE_STRING
virtual void setBool (unsigned index, bool)=0
virtual int getInt (unsigned index) const =0
virtual unsigned int getUInt (unsigned index) const =0
virtual char getChar (unsigned index) const =0
virtual unsigned char getUChar (unsigned index) const =0
virtual short getShort (unsigned index) const =0
virtual unsigned short getUShort (unsigned index) const =0
virtual float getFloat (unsigned index) const =0
virtual double getDouble (unsigned index) const =0
virtual long long getLLong (unsigned index) const =0
virtual const char * getCStr (unsigned index) const =0
 returns column values of type eCOLTYPE_CSTR or eCOLTYPE_STRING
virtual bool getBool (unsigned index) const =0
virtual EchoClass::Type getEchoClass () const =0
virtual int getAsInt (unsigned index) const =0
virtual unsigned int getAsUInt (unsigned index) const =0
virtual char getAsChar (unsigned index) const =0
virtual unsigned char getAsUChar (unsigned index) const =0
virtual short getAsShort (unsigned index) const =0
virtual unsigned short getAsUShort (unsigned index) const =0
virtual float getAsFloat (unsigned index) const =0
virtual double getAsDouble (unsigned index) const =0
virtual long long getAsLLong (unsigned index) const =0
virtual unsigned getFromCStrLength (unsigned index) const =0
 returns buffer length that is required to fully retrieve the column by getFromCStr (+1 for '\0' already included)
virtual bool getFromCStr (unsigned index, char *buffer, unsigned bufferLen) const =0
 stores column value in the provided character buffer
virtual void setFromInt (unsigned index, int)=0
virtual void setFromUInt (unsigned index, unsigned int)=0
virtual void setFromChar (unsigned index, char)=0
virtual void setFromUChar (unsigned index, unsigned char)=0
virtual void setFromShort (unsigned index, short)=0
virtual void setFromUShort (unsigned index, unsigned short)=0
virtual void setFromFloat (unsigned index, float)=0
virtual void setFromDouble (unsigned index, double)=0
virtual void setFromLLong (unsigned index, long long)=0
virtual void setFromCStr (unsigned index, const char *)=0
virtual void eraseLayout (const AddInfoLayoutHandle &layout)=0
 removes the specified attributes from current object

Static Public Member Functions

static bool releaseMemory ()
- Static Public Member Functions inherited from IAddInfoLayout
static const char * getColumnName (ColumnSemantic::Type semantic)
 returns the predefined column name for a specific semantic.
static ColumnType::Type getColumnType (ColumnSemantic::Type semantic)
 returns the column type of a predefined semantic
static ColumnSemantic::Type getColumnSemantic (const char *name, bool caseSensitive=true)
static ColumnType::Type getColumnType (const char *name, bool caseSensitive=true)

Detailed Description

AddInfo objects store a set of attributes.

Managing attributes, layout and views is a core feature of the DM library. Please refer to the Managing Attributes section for implementation concepts and to the examples section (attribute handling) for further details.

Examples:
demoSegmentation.cpp.

Member Function Documentation

virtual IAddInfo* cloneView ( const AddInfoLayoutHandle layout,
bool  readOnly 
) const
pure virtual

creates a new addinfo object with the provide view layout that refers to the same storage object

Whereas setView changes the current addinfo object, cloneView leafs the current object unchanged and creates an new addinfo object using the provide view layout that internal refers to the same storage object. See the attribute handling example in the examples section.

Parameters
[in]layoutview layout that should be used
[in]readOnlyflag if the layout of storage object should be changed, in case the view layout is not a true subset of the storage layout
Returns
new addinfo object
virtual IAddInfo* cloneView ( const AddInfoLayoutHandle viewLayout,
const AddInfoLayoutHandle dataLayout 
) const
pure virtual

creates a new addinfo object with the provide view layout and secures that the storage object contains the dataLayout

Whereas setView changes the current addinfo object, cloneView leafs the current object unchanged and creates an new addinfo object using the provide view layout that internal refers to the same storage object. Furthermore it is checked that all columns of the dataLayout exist in the storage object. If not the storage object is extended. See the attribute handling example in the examples section.

Parameters
[in]viewLayoutview layout that should be set
[in]dataLayoutdefines columns that have to exist in the storage object
virtual void eraseLayout ( const AddInfoLayoutHandle layout)
pure virtual

removes the specified attributes from current object

Parameters
[in]layoutcontains all attributes that should be erased from storage (and storage layout)
virtual bool getFromCStr ( unsigned  index,
char *  buffer,
unsigned  bufferLen 
) const
pure virtual

stores column value in the provided character buffer

Parameters
[in]indexcolumn index
[in,out]buffercharacter buffer
[in]bufferLenlength of reserved character buffer
Returns
true if bufferLen was sufficient for storing the column value, otherwise false
virtual void setView ( const AddInfoLayoutHandle layout,
bool  readOnly 
)
pure virtual

applies a certain layout view onto the current object

In contrast to cloneView the function changes the visible layout of the current object. Since geometry object uses smart pointers to addinfo object this may affect other code parts. The read only parameter does not protect for writing attributes to the addinfo object. The parameter refers to the layout of storage object. The view layout is not necessarily a subset of the storage layout. In such a configuration the disjunct attributes can be added (readOnly = false) to the attribute storage (and storage layout) or not (readOnly = true). In the later case the disjunct attributes still exists in the view layout, but you will not be able to read or write them. Only the isNull check will be valid and, of course, it will always return true for disjunct attributes. In case you want to read/write all attributes of the view layout the read only parameter should be set to false

Parameters
[in]layoutview layout that should be set
[in]readOnlyflag if the layout of storage object should be changed, in case the view layout is not a true subset of the storage layout