00001
00009 #ifndef ClassStMessTypeList
00010 #define ClassStMessTypeList
00011
00012 #include <vector>
00013 #if !defined(ST_NO_NAMESPACES)
00014 using std::vector;
00015 #endif
00016
00017 #ifdef ST_NO_TEMPLATE_DEF_ARGS
00018
00019 #define StVector(T) vector<T, allocator<T> >
00020 typedef vector<int, allocator<int> > intVector;
00021 #else
00022 #define StVector(T) vector<T>
00023 typedef vector<int> intVector;
00024 #endif
00025
00026 class StMessTypePair {
00027 private:
00028 const char* type;
00029 const char* text;
00030 public:
00031 StMessTypePair(const char* ty, const char* te);
00032 virtual ~StMessTypePair();
00033 const char* Type() const {return type;}
00034 const char* Text() const {return text;}
00035 };
00036
00037 typedef StVector(StMessTypePair*) StMessTypeVec;
00038 typedef StVector(StMessTypePair*)::iterator StMessTypeVecIter;
00039
00040
00041 class StMessTypeList {
00042 private:
00043 static StMessTypeList* mInstance;
00044
00045 protected:
00046 StMessTypeVec messList;
00047 StMessTypeList();
00048 StMessTypeList(const StMessTypeList&);
00049
00050 public:
00051 virtual ~StMessTypeList();
00052 static StMessTypeList* Instance();
00053 int AddType(const char* type, const char* text);
00054 int FindTypeNum(const char* type);
00055 StMessTypePair* FindType(const char* type);
00056 const char* FindNumType(size_t typeNum);
00057 const char* FindNumText(size_t typeNum);
00058 const char* Text(const char* type) {
00059 StMessTypePair* temp = FindType(type);
00060 return ( (temp) ? temp->Text() : 0 );
00061 }
00062 int ListTypes();
00063 };
00064
00065 #endif
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099