FieldRegistry.h

Go to the documentation of this file.
00001 #ifndef FIELDREGISTRY_H_
00002 #define FIELDREGISTRY_H_
00003 
00004 #include "Field.h"
00005 
00006 #include <map>
00007 using std::map;
00008 #include <vector>
00009 using std::vector;
00010 
00012 
00013 class FieldRegistry
00014 {
00015 
00016 public:
00017     FieldRegistry(void);
00018     ~FieldRegistry(void);
00019 
00021     void registerField( Field const& f );
00022 
00024     Field const& getField(size_t id) const;
00025 
00027     Field const* findField( string const& name ) const;
00028 
00030     size_t nFields(void)
00031     {
00032         return fields.size();
00033     }
00034 
00036     //string const& getFieldName(int id) {
00037     //  if ( id>=0 && id < nFields() )
00038     //          return fields[id].name;
00039     //  else
00040     //          return NULL;
00041     //}
00042 
00043     // Return 1 if field is READWRITE
00044     //bool isFieldRW(int id) {
00045     //  return (fields[id].access==FieldBase::readwrite);
00046     //}
00047 
00048     // Return the number of doubles needed to store all READWRITE fields
00049     //int getFieldArraySize(void) { return arraySize; };
00050 
00051 private:
00053     vector< Field * > fields;
00054     map< string, size_t > name_to_id_map;
00055 };
00056 
00057 #endif /*FIELDREGISTRY_H_*/

Generated on Wed Jul 9 16:34:37 2008 for PCSIM by  doxygen 1.5.5