librcsb-core-wrapper 1.005
DictObjCont.h
Go to the documentation of this file.
1/*$$FILE$$*/
2/*$$VERSION$$*/
3/*$$DATE$$*/
4/*$$LICENSE$$*/
5
6
14#ifndef DICTOBJCONT_H
15#define DICTOBJCONT_H
16
17
20
22#include <rcsb/DicFile.h>
23
24
36{
37 public:
42 ObjCont(Serializer& ser, DicFile& dicFile, const string& blockName,
43 const string& id, const ObjContInfo& objContInfo);
44
49 virtual ~ObjCont();
50
55 void Init();
56
60 const string& GetName() const;
61
66 virtual void Read(UInt32 which, unsigned int Index = 0);
67
72 virtual UInt32 Write();
73
92 const vector<string>& GetAttribute(const string& catName,
93 const string& itemName) const;
94
108 void Print() const;
109
114 void SetVerbose(bool verbose);
115
120 virtual void Build();
121
122 protected:
124
126
128
130 string _id;
131
133
134 vector<UInt32> _index;
135
136 vector<vector<vector<string> > > _itemsStore;
137
138 virtual void BuildItems(vector<vector<string> >& combo,
139 const unsigned int configIndex);
140 void BuildItems(vector<vector<string> >& combo,
141 const unsigned int configIndex, const string& value);
142
143 private:
144 void ReadItem(const pair<unsigned int, unsigned int>& indexPair,
145 unsigned int Index);
146};
147
148
158class ItemObjCont : public ObjCont
159{
160 public:
166 const string& blockName, const string& itemName);
167
173
178 void Build();
179
180 private:
181 vector<string> _decendency;
182
183 void GetItemDecendency();
184
185 void BuildItems(vector<vector<string> >& combo,
186 const unsigned int configIndex);
187};
188
189
201class DictObjCont : public ObjCont
202{
203 public:
209 const string& blockName);
210
216
221 void Build();
222
228
233 void Read(UInt32 which, unsigned int Index = 0);
234
257 const ObjCont& GetObjCont(const string& contName,
258 const ObjContInfo& objContInfo) const;
259
275 void Print();
276
277 private:
278 mutable mapped_ptr_vector<ObjCont> _items;
279 mutable mapped_ptr_vector<ObjCont> _subcategories;
280 mutable mapped_ptr_vector<ObjCont> _categories;
281
282 DictObjCont(const DictObjCont& dictObjCont);
283 DictObjCont& operator=(const DictObjCont& inDictObjCont);
284
285 UInt32 WriteContLocations(const vector<UInt32>& indices);
286
287 void BuildContainers(unsigned int index, const string& catName,
288 const string& itemName, mapped_ptr_vector<ObjCont>& containers);
289
290 void BuildItems(vector<vector<string> >& combo,
291 const unsigned int configIndex);
292
293 ObjCont& GetContainers(const string& contName,
294 mapped_ptr_vector<ObjCont>& containers, const ObjContInfo& objContInfo)
295 const;
296
297 void PrintContainers(const string& catName,
298 const string& itemName, const ObjContInfo& objContInfo);
299};
300
301
302#endif // DICTOBJCONT_H
303
Header file for DicFile class.
Header file for ObjContInfo, DictObjContInfo, CatObjContInfo, SubcatObjContInfo and ItemObjContInfo c...
Public class that represents a dictionary file, composed of blocks with tables.
Definition DicFile.h:37
Public class that represents a dictionary object container.
Definition DictObjCont.h:202
const ObjCont & GetObjCont(const string &contName, const ObjContInfo &objContInfo) const
DictObjCont(Serializer &ser, DicFile &dicFile, const string &blockName)
void Print()
void Read(UInt32 which, unsigned int Index=0)
UInt32 Write()
void Build()
Private class that represents an item object container.
Definition DictObjCont.h:159
void Build()
ItemObjCont(Serializer &ser, DicFile &dicFile, const string &blockName, const string &itemName)
Public class that represents a generic object container.
Definition DictObjCont.h:36
virtual void Read(UInt32 which, unsigned int Index=0)
virtual ~ObjCont()
const string & GetName() const
void SetVerbose(bool verbose)
void Print() const
DicFile & _dicFile
Definition DictObjCont.h:125
void BuildItems(vector< vector< string > > &combo, const unsigned int configIndex, const string &value)
string _id
Definition DictObjCont.h:130
ObjCont(Serializer &ser, DicFile &dicFile, const string &blockName, const string &id, const ObjContInfo &objContInfo)
Serializer & _ser
Definition DictObjCont.h:123
bool _verbose
Definition DictObjCont.h:132
virtual void Build()
const ObjContInfo & _objContInfo
Definition DictObjCont.h:127
virtual UInt32 Write()
void Init()
const vector< string > & GetAttribute(const string &catName, const string &itemName) const
vector< UInt32 > _index
Definition DictObjCont.h:134
virtual void BuildItems(vector< vector< string > > &combo, const unsigned int configIndex)
vector< vector< vector< string > > > _itemsStore
Definition DictObjCont.h:136
string _blockName
Definition DictObjCont.h:129
Public class that represents a generic information class for the generic object container.
Definition DictObjContInfo.h:40
Definition Serializer.h:44
Definition mapped_ptr_vector.h:30
unsigned int UInt32
Definition rcsb_types.h:15