37 #ifndef _STRUCTTYPE_HH_
38 #define _STRUCTTYPE_HH_
44 #include "catalogmgr/ops.hh"
73 virtual void printCell(ostream& stream,
const char* cell)
const;
78 unsigned int addElement(
const char* elemName,
const char* elemType);
84 unsigned int getOffset(
const char* elemName)
const;
87 unsigned int getOffset(
unsigned int num)
const;
93 const char*
const getElemName(
unsigned int num)
const;
113 StructType(
const char* newTypeName,
unsigned int numElem );
131 virtual r_ULong* convertToCULong(
const char* cell, r_ULong* value)
const;
132 virtual char* makeFromCULong(
char* cell,
const r_ULong* value)
const;
133 virtual r_Long* convertToCLong(
const char* cell, r_Long* value)
const;
134 virtual char* makeFromCLong(
char* cell,
const r_Long* value)
const;
135 virtual double* convertToCDouble(
const char* cell,
double* value)
const;
136 virtual char* makeFromCDouble(
char* cell,
const double* value)
const;
174 #include "structtype.icc"
virtual char * getTypeStructure() const
returns the structure of the type as a C string.
unsigned int addElementPriv(const char *elemName, const BaseType *elemType)
virtual void insertInDb()
unsigned int numElems
The number of elements.
Definition: structtype.hh:163
std::vector< unsigned int > elementOffsets
Array containing offsets to elements.
Definition: structtype.hh:160
virtual void readFromDb()
const char *const getElemName(unsigned int num) const
get name of an element by number of element (0 based).
const BaseType * getElemType(const char *elemName) const
get type of an element by name of element.
StructType & operator=(const StructType &old)
assignment operator.
unsigned int align
Alignment needed for structure if embedded in other structures.
Definition: structtype.hh:166
Definition: compositetype.hh:54
unsigned int getNumElems() const
get number of elements.
Definition: structtype.hh:68
virtual int compatibleWith(const Type *aType) const
virtual void deleteFromDb()
virtual void printCell(ostream &stream, const char *cell) const
unsigned int getAlignment() const
get alignment needed for structure to be embedded in another structure.
Definition: basetype.hh:66
StructType()
default constructor, sets type name to "".
virtual ~StructType()
virtual destructor.
int contains(const StructType *aStruct) const
checks if a certain StructType is contained in this StructType
std::vector< const BaseType * > elements
Array containing references to base types of elements.
Definition: structtype.hh:154
virtual r_Bytes getMemorySize() const
std::vector< char * > elementNames
Array containing names of elements.
Definition: structtype.hh:157
unsigned int addElement(const char *elemName, const char *elemType)
add new element to struct
unsigned int getOffset(const char *elemName) const
get offset for an element by name of element.