librcsb-core-wrapper  1.000
CifParentChild.h
Go to the documentation of this file.
1 //$$FILE$$
2 //$$VERSION$$
3 //$$DATE$$
4 //$$LICENSE$$
5 
6 
14 #ifndef CIFPARENTCHILD_H
15 #define CIFPARENTCHILD_H
16 
17 
18 #include <string>
19 #include <vector>
20 #include <sstream>
21 
22 #include <rcsb/ISTable.h>
23 #include <rcsb/TableFile.h>
24 #include <rcsb/ParentChild.h>
25 
26 
27 #define JW_HACK
28 
29 #ifdef JW_HACK
30 // JW_DEBUG invokes significant debug printout associated with parent
31 // child checking. Some hacks have been introduced to improve
32 // checking in this module.
33 // #define JW_DEBUG 1
34 #endif
35 
36 
38 {
39  public:
40  CifParentChild(Block& block);
41  CifParentChild(Block& block, ISTable* parChildTableP);
42 
43  virtual ~CifParentChild();
44 
45  int CheckParentChild(Block& block, ISTable& catTable,
46  std::ostringstream& log);
47 
48  void WriteGroupTables(Block& block);
49 
50  protected:
51  void GetParentCifItems(std::vector<std::string>& parCifItems,
52  const std::string& cifItemName);
53 
54  private:
55  ISTable* _parChildTableP;
56 
57  ISTable* _inParChildGroupP;
58  ISTable* _inParChildGroupListP;
59 
60  void Init(Block& block);
61 
62  ISTable* CreateKeysTableOld(const std::vector<std::string>& cifItemNames,
63  std::map<std::string, unsigned int>& maxKeyGroups);
64 
65  void FillKeysTableOld(ISTable& keysTable,
66  const std::vector<std::string>& cifItemNames,
67  std::map<std::string, unsigned int>& maxKeyGroups);
68 
69  void BuildOldTables(const std::vector<std::string>& cats,
70  const std::vector<std::vector<std::string> >& items);
71 
72  void BuildNewTables(const std::vector<std::string>& cats,
73  const std::vector<std::vector<std::string> >& items);
74 
75  void FilterMissingItems(std::vector<std::vector<std::string> >& parParKeys,
76  std::vector<std::vector<std::string> >& comboComboKeys,
77  const std::vector<std::string>& cifItemNames);
78 
79  unsigned int LastGroupNum(const std::string& childCat);
80 };
81 
82 
83 #endif
84