librcsb-core-wrapper  1.005
DictObjContInfo.h
Go to the documentation of this file.
1 //$$FILE$$
2 //$$VERSION$$
3 //$$DATE$$
4 //$$LICENSE$$
5 
6 
15 #ifndef DICTOBJCONTINFO_H
16 #define DICTOBJCONTINFO_H
17 
18 
19 #include <string>
20 #include <map>
21 
22 #include <rcsb/Serializer.h>
23 #include <rcsb/rcsb_types.h>
24 #include <rcsb/CifString.h>
25 
26 
40 {
41  public:
47  class Item
48  {
49  public:
50  std::string descr;
51  std::string itemName;
52  };
53 
59  class Cat
60  {
61  public:
62  std::string catName;
63  std::string col1;
66  std::vector<Item> items;
67  };
68 
69  std::string _objContInfoDescr;
70 
71  std::vector<Cat> _cats;
72 
73  std::map<std::pair<std::string, std::string>, std::pair<unsigned int,
74  unsigned int> > _catMap;
75 
80  void AddCat(const std::string& catName);
81 
86  void AddCat(const std::string& catName, const std::string& col1,
87  const bool nonDefaultValue = false, const bool inheritance = false);
88 
93  void AddItem(const std::string& descr, const std::string& itemName);
94 
99  unsigned int GetItemIndex(const std::string& catName,
100  const std::string& itemName) const;
101 
106  std::pair<unsigned int, unsigned int> GetItemIndices(
107  const std::string& catName, const std::string& itemName) const;
108 
109 #ifndef VLAD_PYTHON_GLUE
110 
114  virtual ~ObjContInfo();
115 #endif
116 
117  protected:
122  ObjContInfo();
123 
124  private:
125  std::vector<Cat>::iterator currCat;
126 };
127 
128 
136 {
137  public:
138  static DictObjContInfo& GetInstance();
139 
140  private:
141  DictObjContInfo();
142  DictObjContInfo(const DictObjContInfo& in);
143 
144  ~DictObjContInfo();
145 
146  DictObjContInfo& operator=(const DictObjContInfo& in);
147 };
148 
149 
157 {
158  public:
159  static CatObjContInfo& GetInstance();
160 
161  private:
162  CatObjContInfo();
163  CatObjContInfo(const CatObjContInfo& in);
164 
165  ~CatObjContInfo();
166 
167  CatObjContInfo& operator=(const CatObjContInfo& in);
168 };
169 
170 
178 {
179  public:
180  static SubcatObjContInfo& GetInstance();
181 
182  private:
185 
187 
188  SubcatObjContInfo& operator=(const SubcatObjContInfo& in);
189 };
190 
191 
199 {
200  public:
201  static ItemObjContInfo& GetInstance();
202 
203  private:
204  ItemObjContInfo();
205  ItemObjContInfo(const ItemObjContInfo& in);
206 
207  ~ItemObjContInfo();
208 
209  ItemObjContInfo& operator=(const ItemObjContInfo& in);
210 };
211 
212 
213 #endif // DICTOBJCONTINFO_H
virtual ~ObjContInfo()
std::vector< Item > items
Definition: DictObjContInfo.h:66
bool inheritance
Definition: DictObjContInfo.h:65
std::string descr
Definition: DictObjContInfo.h:50
Private class that represents an information class for the dictionary object container.
Definition: DictObjContInfo.h:135
Private class that represents a category.
Definition: DictObjContInfo.h:59
void AddCat(const std::string &catName)
std::pair< unsigned int, unsigned int > GetItemIndices(const std::string &catName, const std::string &itemName) const
Private class that represents an item.
Definition: DictObjContInfo.h:47
std::map< std::pair< std::string, std::string >, std::pair< unsigned int, unsigned int > > _catMap
Definition: DictObjContInfo.h:74
std::string catName
Definition: DictObjContInfo.h:62
Private class that represents an information class for the category object container.
Definition: DictObjContInfo.h:156
std::string itemName
Definition: DictObjContInfo.h:51
Public class that represents a generic information class for the generic object container.
Definition: DictObjContInfo.h:39
unsigned int GetItemIndex(const std::string &catName, const std::string &itemName) const
Private class that represents an information class for the sub-category object container.
Definition: DictObjContInfo.h:177
std::string col1
Definition: DictObjContInfo.h:63
std::string _objContInfoDescr
Definition: DictObjContInfo.h:69
std::vector< Cat > _cats
Definition: DictObjContInfo.h:71
void AddItem(const std::string &descr, const std::string &itemName)
bool nonDefaultValue
Definition: DictObjContInfo.h:64
Private class that represents an information class for the item object container. ...
Definition: DictObjContInfo.h:198