BIE |
/home/weinberg/src/BIE/include/RecordType.h00001 // This is really -*- C++ -*- 00002 00003 #ifndef RecordType_h 00004 #define RecordType_h 00005 00006 #include <string> 00007 #include <vector> 00008 00009 #include "AsciiLexer.h" 00010 #include "BasicType.h" 00011 00012 #include "Serializable.h" 00013 00014 00015 namespace BIE { 00016 00017 //+ CLICLASS RecordType 00034 class RecordType: public Serializable { 00035 00036 public: 00037 //+ CLICONSTR 00039 RecordType(){} 00040 00041 //+ CLICONSTR RecordType* 00047 RecordType(RecordType * recordtypetocopy); 00048 00051 typedef struct field { 00053 const char * fieldname; 00055 const BasicType * fieldtype; 00056 } fieldstruct; 00057 00059 RecordType(const fieldstruct * typetable); 00060 00061 //+ CLICONSTR istream* 00063 RecordType(istream *istrm); 00064 00065 //+ CLIMETHOD RecordType* deleteField string 00070 RecordType * deleteField (string fieldname); 00071 00072 //+ CLIMETHOD RecordType* deleteField int 00077 RecordType * deleteField (int v); 00078 00079 //+ CLIMETHOD RecordType* deleteRange int int 00086 RecordType * deleteRange (int lowfieldindex, int highfieldindex); 00087 00088 //+ CLIMETHOD RecordType* insertField int string BasicType* 00099 RecordType * insertField(int insertpos, string fieldname, BasicType * fieldtype); 00100 00101 //+ CLIMETHOD RecordType* insertRecord int RecordType* 00109 RecordType * insertRecord(int position, RecordType * insertRecord); 00110 00111 //+ CLIMETHOD RecordType* unionWithRecord RecordType* 00118 RecordType * unionWithRecord(RecordType * insertrec); 00119 00120 //+ CLIMETHOD RecordType* selectFields vector<int>* 00126 RecordType * selectFields(vector<int> * selection); 00127 00128 //+ CLIMETHOD RecordType* selectFields vector<string>* 00134 RecordType * selectFields(vector<string>* selection); 00135 00136 //+ CLIMETHOD RecordType* renameField string string 00141 RecordType * renameField(string oldname, string newname); 00142 00143 //+ CLIMETHOD RecordType* renameField int string 00148 RecordType * renameField(int fieldindex, string newname); 00149 00150 //+ CLIMETHOD RecordType* moveField string int 00156 RecordType * moveField(string fieldname, int newposition); 00157 00158 //+ CLIMETHOD RecordType* moveField int int 00164 RecordType * moveField(int oldposition, int newposition); 00165 00166 //+ CLIMETHOD int getFieldIndex string 00168 int getFieldIndex(string fieldname); 00169 00170 //+ CLIMETHOD string getFieldName int 00172 string getFieldName(int fieldindex); 00173 00174 //+ CLIMETHOD bool isValidFieldIndex int 00176 bool isValidFieldIndex(int fieldindex); 00177 00178 //+ CLIMETHOD bool isValidFieldName string 00180 bool isValidFieldName(string fieldname); 00181 00182 //+ CLIMETHOD BasicType* getFieldType int 00184 BasicType * getFieldType(int fieldindex); 00185 00186 //+ CLIMETHOD BasicType* getFieldType string 00188 BasicType * getFieldType(string fieldindex); 00189 00190 //+ CLIMETHOD int numFields 00192 int numFields(); 00193 00194 //+ CLIMETHOD bool equals RecordType* 00197 bool equals (RecordType *); 00198 00199 //+ CLIMETHOD bool orderedEquals RecordType* 00204 bool orderedEquals(RecordType *); 00205 00206 //+ CLIMETHOD bool isSubset RecordType* 00209 bool isSubset (RecordType *); 00210 00211 //+ CLIMETHOD bool isPrefix RecordType* 00213 bool isPrefix (RecordType *); 00214 00215 //+ CLIMETHOD string createHeaderForStream 00217 string createHeaderForStream(); 00218 00220 static int getLength(AsciiLexer *lxr); 00221 00222 //+ CLIMETHOD string toString 00224 string toString(); 00225 00226 private: 00228 vector<string> record_fieldnames; 00229 00231 vector<BasicType *> record_fieldtypes; 00232 00233 // AUTO GENERATED BY ../persistence/autopersist.py 00234 private: 00235 friend class boost::serialization::access; 00236 template<class Archive> 00237 void serialize(Archive & ar, const unsigned int version) { 00238 this->pre_serialize(ar, version); 00239 try { 00240 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Serializable); 00241 BIE_CATCH_BOOST_SERIALIZATION_EXCEPTION; 00242 } 00243 try { 00244 ar & BOOST_SERIALIZATION_NVP(record_fieldnames); 00245 BIE_CATCH_BOOST_SERIALIZATION_EXCEPTION; 00246 } 00247 try { 00248 ar & BOOST_SERIALIZATION_NVP(record_fieldtypes); 00249 BIE_CATCH_BOOST_SERIALIZATION_EXCEPTION; 00250 } 00251 this->post_serialize(ar, version); 00252 } 00253 00254 }; 00255 00256 } // namespace BIE 00257 00258 BIE_CLASS_TYPE_INFO(BIE::RecordType) 00259 BIE_CLASS_EXPORT_KEY(BIE::RecordType) 00260 #endif 00261 Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU. Documentation generated at Fri Mar 26 00:35:10 2010 by
|