ParentChild.h

Go to the documentation of this file.
00001 //$$FILE$$
00002 //$$VERSION$$
00003 //$$DATE$$
00004 //$$LICENSE$$
00005 
00006 
00014 #ifndef PARENTCHILD_H
00015 #define PARENTCHILD_H
00016 
00017 
00018 #include <string>
00019 #include <vector>
00020 #include <map>
00021 
00022 #include "ISTable.h"
00023 
00024 
00025 class ParentChild
00026 {
00027   public:
00028     ParentChild();
00029     virtual ~ParentChild();
00030 
00031     const std::vector<std::vector<std::string> >&
00032       GetComboKeys(const std::string& catName);
00033 
00034     std::vector<std::vector<std::vector<std::string> > >&
00035       GetChildrenKeys(const std::vector<std::string>& parComboKey);
00036 
00037     void GetParents(std::vector<std::vector<std::string> >& parParKeys,
00038       std::vector<std::vector<std::string> >& comboComboKeys,
00039       const std::string& childCat);
00040 
00041     void GetLinkGroupIdLabel(std::string& linkGroupIdLabel,
00042       const std::vector<std::string>& parKeys,
00043       const std::vector<std::string>& childKeys);
00044 
00045     bool IsParKeyPresent(const std::vector<std::string>& parKey,
00046       const std::string& childCatName);
00047 
00048     bool IsInParentComboKeys(const std::string& itemName);
00049 
00050     ISTable* _groupTableP;
00051     ISTable* _groupListTableP;
00052 
00053   protected:
00054     // Maps parent category name to its combo keys.
00055     std::map<std::string, std::vector<std::vector<std::string> > >
00056       _parComboKeys;
00057 
00058     // Maps parent combo keys to children combo keys.
00059     std::map<std::vector<std::string>,
00060       std::vector<std::vector<std::vector<std::string> > > > _relations;
00061 
00062     void GetComboKeys(const std::string& parCatName,
00063       const unsigned int maxKeyGroup, ISTable& keysTable, 
00064       std::vector<std::vector<std::string> >& comboKeys,
00065       std::vector<std::string>& parKeys);
00066 
00067     virtual void GetParentCifItems(std::vector<std::string>& parCifItems,
00068       const std::string& cifItemName) = 0;
00069 
00070     void AddParentCategoryToItemLinkedGroup(ISTable& itemLinkedGroup,
00071       ISTable& itemLinkedGroupList);
00072 
00073     void CreateAllRelations(ISTable& itemLinkedGroup,
00074       ISTable& itemLinkedGroupList);
00075 
00076     void ISTableFindPairs(std::map<std::string,
00077       std::vector<std::vector<std::string> > >& childrenKeys,
00078       const std::vector<std::string>& parKeys, ISTable& itemLinkedGroupList);
00079 
00080     void UpdateMap(std::map<std::string,
00081       std::vector<std::vector<std::string> > >& childrenKeys,
00082       const std::string& childCat, std::vector<std::string>& childKeys);
00083 
00084     void UpdateParComboKeys(const std::string& parName,
00085       std::vector<std::string>& parKeys);
00086 
00087     void UpdateRelations(std::vector<std::string>& parKeys,
00088       std::vector<std::vector<std::string> >& comboKeys);
00089 
00090     bool KeysMatch(const std::vector<std::string>& firstKey,
00091       const std::vector<std::string>& secondKey);
00092 };
00093 
00094 
00095 #endif
00096 

Generated on Thu Sep 29 09:19:18 2011 for cif-file-v1.1.0 by  doxygen 1.4.7