00001 00002 00003 #ifndef _EPICS_FIELDTYPEMANAGER_H 00004 #define _EPICS_FIELDTYPEMANAGER_H 00005 00006 #include <string> 00007 #include <map> 00008 00009 #include "epics/pvdata/FieldType.h" 00010 00011 #include "epics/pvdata/LongType.h" 00012 #include "epics/pvdata/FloatType.h" 00013 #include "epics/pvdata/DoubleType.h" 00014 #include "epics/pvdata/StringType.h" 00015 #include "epics/pvdata/ArrayType.h" 00016 #include "epics/pvdata/StructureType.h" 00017 00018 namespace EPICS 00019 { 00020 00022 class FieldTypeManager 00023 { 00024 public: 00025 00027 static FieldTypeManager* getInstance(); 00028 00029 public: 00030 00031 // generic interface 00032 00034 StructureType* registerStructureType(const char* name, 00035 const std::vector<std::string>& fieldNames, 00036 const std::vector<FieldType*>& fieldTypes); 00037 00039 ArrayType* registerArrayType(const char* name, 00040 const FieldType* elementType); 00041 00043 FieldType* getFieldType(const char* name); 00044 00045 public: 00046 00048 LongType* getLongType() { return &m_longType; } 00049 00051 FloatType* getFloatType() { return &m_floatType; } 00052 00054 DoubleType* getDoubleType() { return &m_doubleType; } 00055 00057 StringType* getStringType() { return &m_stringType; } 00058 00059 protected: 00060 00062 FieldTypeManager(); 00063 00064 protected: 00065 00067 static FieldTypeManager* s_theInstance; 00068 00069 protected: 00070 00072 std::map< std::string, FieldType* > m_fieldTypes; 00073 00074 protected: 00075 00076 LongType m_longType; 00077 FloatType m_floatType; 00078 DoubleType m_doubleType; 00079 StringType m_stringType; 00080 00081 }; 00082 } 00083 00084 00085 #endif /* _FIELDTYPEMANAGER_H */ 00086