00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef OT_MAP_H
00025 #define OT_MAP_H
00026
00027
00029
00030
00031
00032 class ot_map : public ot_obj, public map<string,ot_obj *>
00033 {
00034
00035 private:
00036
00037 void clearAll(void);
00038 void copyFrom(const ot_map &c);
00039
00040
00041 public:
00042
00043
00044
00045
00046
00047
00049 ot_map(void);
00050
00053 ot_map(const ot_map &c);
00054
00056 virtual ~ot_map();
00057
00058
00059
00060
00061
00062
00066 ot_obj *dup(void) const;
00067
00071 void asXml(ostream &s=cout,int i=0) const;
00072
00075 bool asData(ostream &s) const;
00076
00077
00078
00079
00080
00081
00082
00084
00085
00086
00087 const ot_obj *get(const string &pos) const;
00088
00090
00091
00092
00093
00094 ot_obj *getPtr(const string &pos);
00095
00097
00098
00099
00100
00101 bool insert(const string &pos,const ot_obj *o);
00102
00104
00105
00106
00107
00108 bool insert(const string &pos,const ot_obj &o);
00109
00110 bool insertPtr(const string &pos,ot_obj *o);
00111
00113
00114
00115
00116 bool erase(const ot_obj *o);
00117
00119
00120
00121
00122 bool erase(const string &o);
00123
00124
00125
00126
00127
00129 ot_map & operator = (const ot_map &c);
00130
00132 bool operator == (const ot_map &c);
00133
00135 bool operator != (const ot_map &v);
00136
00138 bool operator == (const ot_obj *o) const
00139 {
00140 if(o && o->getType()==getType()) return(*this==*((ot_map *) o));
00141 else return(false);
00142 }
00143
00144 };
00145
00146 #endif
00147