00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GB_AttributeTable_h__
00021 #define __GB_AttributeTable_h__
00022
00023 #include "GB_API.h"
00024 #include "GB_AttributeData.h"
00025 #include "GB_AttributeDefines.h"
00026 #include "GB_AttributeDict.h"
00027
00028 class GB_API GB_AttributeTable : public GB_AttributeDict
00029 {
00030 public:
00031 GB_AttributeTable() {}
00032 ~GB_AttributeTable();
00033
00034 int append(const char *n, int s, GB_AttribType type,
00035 GB_AttribTypeInfo type_info, const void *defValue);
00036 int appendClone(const GB_Attribute *src);
00037
00038 void destroy(const char *name, int size, GB_AttribType type);
00039
00040
00041 void destroy(const char *name, GB_AttribType type);
00042
00043 void clearAndDestroy(void)
00044 {
00045 GB_AttributeDict::clearAndDestroy();
00046 attribData.deleteData();
00047 }
00048
00049 void changeDataSize(int s) { attribData.changeSize(s); }
00050 int grow(const char *n, int oldsize, GB_AttribType type,
00051 unsigned int addedsize);
00052
00053
00054
00055
00056
00057
00058
00059 int shrink(const char *n, int oldsize, GB_AttribType type,
00060 unsigned int removedsize, int remove_offset );
00061
00062
00063
00064 void SYS_DEPRECATED *getAttribData(int n) const
00065 { return attribData.getData(n); }
00066
00067 template<typename T>
00068 T *castAttribData(int n)
00069 { return (T *)attribData.getData(n); }
00070 template<typename T>
00071 const T *castAttribData(int n) const
00072 { return (T *)attribData.getData(n); }
00073
00074
00075
00076
00077 void sortAs(const GB_AttributeDict &) {};
00078
00079
00080
00081 int save(ostream &os, int binary) const
00082 {
00083 return GB_AttributeDict::save(os, attribData, binary);
00084 }
00085 bool load(UT_IStream &is)
00086 {
00087 return GB_AttributeDict::load(is, attribData);
00088 }
00089
00090
00091
00092 const GB_AttributeData &getAttrib() const { return attribData; }
00093 GB_AttributeData &getAttrib() { return attribData; }
00094 private:
00095 GB_AttributeData attribData;
00096
00097 };
00098
00099 #endif