rasdaman base DBMS
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StructType Class Reference

#include <structtype.hh>

Inheritance diagram for StructType:
CompositeType BaseType Type DBNamedObject DBObject

Public Member Functions

virtual void printCell (ostream &stream, const char *cell) const
 
virtual char * getTypeStructure () const
 returns the structure of the type as a C string. More...
 
unsigned int addElement (const char *elemName, const char *elemType)
 add new element to struct More...
 
unsigned int addElement (const char *elemName, const BaseType *elemType)
 add new element to struct using pointer to BaseType More...
 
unsigned int getOffset (const char *elemName) const
 get offset for an element by name of element. More...
 
unsigned int getOffset (unsigned int num) const
 get offset for an element by number of element (0 based). More...
 
const BaseTypegetElemType (const char *elemName) const
 get type of an element by name of element. More...
 
const char *const getElemName (unsigned int num) const
 get name of an element by number of element (0 based). More...
 
const BaseTypegetElemType (unsigned int num) const
 get type of an element by number of element (0 based). More...
 
unsigned int getNumElems () const
 get number of elements. More...
 
unsigned int getAlignment () const
 get alignment needed for structure to be embedded in another structure. More...
 
int contains (const StructType *aStruct) const
 checks if a certain StructType is contained in this StructType More...
 
 StructType (const OId &structtypeid) throw (r_Error)
 
 StructType ()
 default constructor, sets type name to "". More...
 
 StructType (const char *newTypeName, unsigned int numElem)
 constructor getting type name and number of elements. More...
 
 StructType (const StructType &old)
 copy constructor. More...
 
StructTypeoperator= (const StructType &old)
 assignment operator. More...
 
virtual ~StructType ()
 virtual destructor. More...
 
virtual int compatibleWith (const Type *aType) const
 
virtual r_Bytes getMemorySize () const
 
- Public Member Functions inherited from CompositeType
virtual unsigned int getSize () const
 
 CompositeType ()
 
 CompositeType (const OId &id) throw (r_Error)
 
 CompositeType (const CompositeType &old)
 
 CompositeType (unsigned int newSize)
 
virtual ~CompositeType ()
 
CompositeTypeoperator= (const CompositeType &old)
 
- Public Member Functions inherited from BaseType
 BaseType ()
 
 BaseType (const OId &id) throw (r_Error)
 
 BaseType (const BaseType &old)
 
BaseTypeoperator= (const BaseType &old)
 
virtual ~BaseType ()
 
virtual CondenseOp * getCondenseOp (Ops::OpType op) const
 get function object for condense operation. More...
 
virtual UnaryOp * getUnaryOp (Ops::OpType op, const BaseType *optype) const
 get function object for unary operation. More...
 
virtual BinaryOp * getBinaryOp (Ops::OpType op, const BaseType *op1type, const BaseType *op2type) const
 get function object for binary operation. More...
 
- Public Member Functions inherited from Type
virtual void destroy ()
 
virtual const char * getTypeName () const
 returns the name of the type as a C string. More...
 
const TypeEnum getType () const
 
 Type ()
 
 Type (const OId &id) throw (r_Error)
 
 Type (const Type &old)
 
Typeoperator= (const Type &old)
 
virtual ~Type ()
 
- Public Member Functions inherited from DBNamedObject
 DBNamedObject ()
 
 DBNamedObject (const OId &id) throw (r_Error)
 
 DBNamedObject (const DBNamedObject &old)
 
 DBNamedObject (const char *name)
 
 DBNamedObject (const OId &id, const char *name)
 
virtual ~DBNamedObject ()
 
const char * getName () const
 
DBNamedObjectoperator= (const DBNamedObject &old)
 
virtual void printStatus (unsigned int level=0, std::ostream &stream=std::cout) const
 
- Public Member Functions inherited from DBObject
int getReferenceCount (void) const
 
void incrementReferenceCount (void)
 
void decrementReferenceCount (void)
 
virtual ~DBObject ()
 
 DBObject ()
 
 DBObject (const DBObject &old)
 
 DBObject (const OId &id) throw (r_Error)
 
virtual void setPersistent (bool newPersistent) throw (r_Error)
 
bool isPersistent () const
 
void validate () throw (r_Error)
 
virtual void setModified () throw (r_Error)
 
bool isModified () const
 
OId getOId () const
 
EOId getEOId () const
 
OId::OIdType getObjectType () const
 
DBObjectoperator= (const DBObject &old)
 
bool isCached () const
 
virtual void setCached (bool newCached)
 
virtual r_Bytes getTotalStorageSize () const
 
virtual BinaryRepresentation getBinaryRepresentation () const throw (r_Error)
 
virtual void setBinaryRepresentation (const BinaryRepresentation &) throw (r_Error)
 
virtual char * getBinaryName () const
 

Protected Member Functions

virtual void insertInDb () throw (r_Error)
 
virtual void deleteFromDb () throw (r_Error)
 
virtual void readFromDb () throw (r_Error)
 
void moveBack (int pos)
 
void calcSize ()
 
unsigned int addElementPriv (const char *elemName, const BaseType *elemType)
 
- Protected Member Functions inherited from CompositeType
 CompositeType (const char *name, unsigned int newSize)
 
- Protected Member Functions inherited from BaseType
 BaseType (const char *name)
 
- Protected Member Functions inherited from Type
 Type (const char *name)
 
- Protected Member Functions inherited from DBNamedObject
void setName (const char *newname)
 
void setName (const short length, const char *data)
 
- Protected Member Functions inherited from DBObject
virtual void release ()
 
virtual void updateInDb () throw (r_Error)
 

Protected Attributes

std::vector< const BaseType * > elements
 Array containing references to base types of elements. More...
 
std::vector< char * > elementNames
 Array containing names of elements. More...
 
std::vector< unsigned int > elementOffsets
 Array containing offsets to elements. More...
 
unsigned int numElems
 The number of elements. More...
 
unsigned int align
 Alignment needed for structure if embedded in other structures. More...
 
- Protected Attributes inherited from CompositeType
unsigned int size
 
- Protected Attributes inherited from Type
TypeEnum myType
 
- Protected Attributes inherited from DBNamedObject
char * myName
 
unsigned short myNameSize
 
- Protected Attributes inherited from DBObject
bool _isPersistent
 
bool _isInDatabase
 
bool _isModified
 
bool _isCached
 
OId myOId
 
OId::OIdType objecttype
 
int referenceCount
 

Additional Inherited Members

- Static Public Attributes inherited from DBNamedObject
static short MAXNAMELENGTH
 
- Static Protected Attributes inherited from DBNamedObject
static const char * defaultName
 

Constructor & Destructor Documentation

StructType::StructType ( const OId structtypeid)
throw (r_Error
)
StructType::StructType ( )

default constructor, sets type name to "".

StructType::StructType ( const char *  newTypeName,
unsigned int  numElem 
)

constructor getting type name and number of elements.

StructType::StructType ( const StructType old)

copy constructor.

virtual StructType::~StructType ( )
virtual

virtual destructor.

Member Function Documentation

unsigned int StructType::addElement ( const char *  elemName,
const char *  elemType 
)

add new element to struct

unsigned int StructType::addElement ( const char *  elemName,
const BaseType elemType 
)

add new element to struct using pointer to BaseType

unsigned int StructType::addElementPriv ( const char *  elemName,
const BaseType elemType 
)
protected

add new element to struct using pointer to BaseType does the actuall adding. the public method will not let a persitent type be changed

void StructType::calcSize ( )
protected
virtual int StructType::compatibleWith ( const Type aType) const
virtual

Reimplemented from BaseType.

int StructType::contains ( const StructType aStruct) const

checks if a certain StructType is contained in this StructType

virtual void StructType::deleteFromDb ( )
throw (r_Error
)
protectedvirtual

Reimplemented from DBObject.

unsigned int StructType::getAlignment ( ) const

get alignment needed for structure to be embedded in another structure.

const char* const StructType::getElemName ( unsigned int  num) const

get name of an element by number of element (0 based).

const BaseType* StructType::getElemType ( const char *  elemName) const

get type of an element by name of element.

const BaseType* StructType::getElemType ( unsigned int  num) const

get type of an element by number of element (0 based).

virtual r_Bytes StructType::getMemorySize ( ) const
virtual

Reimplemented from DBNamedObject.

unsigned int StructType::getNumElems ( ) const

get number of elements.

unsigned int StructType::getOffset ( const char *  elemName) const

get offset for an element by name of element.

unsigned int StructType::getOffset ( unsigned int  num) const

get offset for an element by number of element (0 based).

virtual char* StructType::getTypeStructure ( ) const
virtual

returns the structure of the type as a C string.

Reimplemented from Type.

virtual void StructType::insertInDb ( )
throw (r_Error
)
protectedvirtual

Reimplemented from DBObject.

void StructType::moveBack ( int  pos)
protected
StructType& StructType::operator= ( const StructType old)

assignment operator.

virtual void StructType::printCell ( ostream &  stream,
const char *  cell 
) const
virtual

Implements BaseType.

virtual void StructType::readFromDb ( )
throw (r_Error
)
protectedvirtual

Reimplemented from DBObject.

Member Data Documentation

unsigned int StructType::align
protected

Alignment needed for structure if embedded in other structures.

std::vector< char* > StructType::elementNames
protected

Array containing names of elements.

std::vector< unsigned int > StructType::elementOffsets
protected

Array containing offsets to elements.

std::vector< const BaseType* > StructType::elements
protected

Array containing references to base types of elements.

unsigned int StructType::numElems
protected

The number of elements.


The documentation for this class was generated from the following file: