DictObjCont.h

Go to the documentation of this file.
00001 /*$$FILE$$*/
00002 /*$$VERSION$$*/
00003 /*$$DATE$$*/
00004 /*$$LICENSE$$*/
00005 
00006 
00014 #ifndef DICTOBJCONT_H
00015 #define DICTOBJCONT_H
00016 
00017 
00018 #include "mapped_ptr_vector.h"
00019 #include "mapped_ptr_vector.C"
00020 
00021 #include "DictObjContInfo.h"
00022 #include "DdlFile.h"
00023 #include "DicFile.h"
00024 
00025 
00036 class ObjCont
00037 {
00038   public:
00043     ObjCont(FileNavigator& fileNav, DicFile& dicFile, const string& blockName,
00044       const string& id, const ObjContInfo& objContInfo);
00045 
00050     virtual ~ObjCont();
00051 
00056     void Init();
00057 
00062     string GetName();
00063 
00068     virtual int Read(uWord which, unsigned int Index = 0);
00069 
00074     virtual int Write();
00075 
00094     const vector<string>& GetAttribute(const string& catName,
00095       const string& itemName) const;
00096 
00110     void Print();
00111 
00116     void SetVerbose(bool verbose);
00117 
00122     virtual void Build();
00123 
00124   protected:
00125     FileNavigator& _fileNav;
00126 
00127     DicFile& _dicFile;
00128 
00129     const ObjContInfo& _objContInfo;
00130 
00131     string _blockName;
00132     string _id; 
00133 
00134     bool _verbose;
00135 
00136     vector<Word> _index;
00137 
00138     vector<vector<vector<string> > > _itemsStore;
00139 
00140     virtual void BuildItems(vector<vector<string> >& combo,
00141       const unsigned int configIndex);
00142     virtual void BuildItems(vector<vector<string> >& combo,
00143       const unsigned int configIndex, const string& value);
00144 
00145   private:
00146     int ReadItem(const pair<unsigned int, unsigned int>& indexPair,
00147       unsigned int Index);
00148     int WriteItem(const pair<unsigned int, unsigned int>& indices);
00149 };
00150 
00151 
00161 class ItemObjCont : public ObjCont
00162 {
00163   public:
00168     ItemObjCont(FileNavigator& fileNav, DicFile& dicFile,
00169       const string& blockName, const string& itemName);
00170 
00175     ~ItemObjCont();
00176 
00181     void Build();
00182 
00183   private:
00189     typedef struct
00190     {
00191         string name;
00192         int generation;
00193     } family_member;
00194  
00195     // A convenient and complete decendency list
00196     vector<family_member> _decendency;
00197 
00198     void GetItemDecendency(vector<family_member>& decendency);
00199 
00200     void BuildItems(vector<vector<string> >& combo,
00201       const unsigned int configIndex);
00202 };
00203 
00204 
00216 class DictObjCont : public ObjCont
00217 {
00218   public:
00223     DictObjCont(FileNavigator& fileNav, const string& blockName);
00224 
00229     DictObjCont(FileNavigator& fileNav, DicFile& dicFile,
00230       const string& blockName);
00231 
00236     ~DictObjCont();
00237 
00242     void Build();
00243 
00248     int Write();
00249 
00254     void Read(uWord which);
00255 
00278     ObjCont& GetObjCont(const string& contName,
00279       const ObjContInfo& objContInfo);
00280 
00296     void Print();
00297 
00298   private:
00299     mapped_ptr_vector<ObjCont> _items;
00300     mapped_ptr_vector<ObjCont> _subcategories;
00301     mapped_ptr_vector<ObjCont> _categories;
00302 
00303     DictObjCont(const DictObjCont& dictObjCont);
00304     DictObjCont& operator=(const DictObjCont& inDictObjCont);
00305 
00306     void Init();
00307 
00308     int WriteContLocations(const vector<uWord>& indices);
00309 
00310     int BuildContainers(unsigned int index, const string& catName,
00311       const string& itemName, mapped_ptr_vector<ObjCont>& containers);
00312 
00313     void BuildItems(vector<vector<string> >& combo,
00314       const unsigned int configIndex);
00315 
00316     ObjCont& GetContainers(const string& contName,
00317       mapped_ptr_vector<ObjCont>& containers, const ObjContInfo& objContInfo);
00318 
00319     void PrintContainers(const string& catName,
00320       const string& itemName, const ObjContInfo& objContInfo);
00321 };
00322 
00323 
00324 #endif // DICTOBJCONT_H
00325 

Generated on Thu May 10 09:41:23 2007 for dict-obj-file-v8.0 by  doxygen 1.5.1