ParentChild.h
Go to the documentation of this file.
//$$FILE$$
//$$VERSION$$
//$$DATE$$
//$$LICENSE$$
#ifndef PARENTCHILD_H
#define PARENTCHILD_H
#include <string>
#include <vector>
#include <map>
#include <rcsb/ISTable.h>
class ParentChild
{
public:
ParentChild();
virtual ~ParentChild();
const std::vector<std::vector<std::string> >&
GetComboKeys(const std::string& catName);
std::vector<std::vector<std::vector<std::string> > >&
GetChildrenKeys(const std::vector<std::string>& parComboKey);
void GetParents(std::vector<std::vector<std::string> >& parParKeys,
std::vector<std::vector<std::string> >& comboComboKeys,
const std::string& childCat);
void GetLinkGroupIdLabel(std::string& linkGroupIdLabel,
const std::vector<std::string>& parKeys,
const std::vector<std::string>& childKeys);
bool IsParKeyPresent(const std::vector<std::string>& parKey,
const std::string& childCatName);
bool IsInParentComboKeys(const std::string& itemName);
ISTable* _groupTableP;
ISTable* _groupListTableP;
protected:
// Maps parent category name to its combo keys.
std::map<std::string, std::vector<std::vector<std::string> > >
_parComboKeys;
// Maps parent combo keys to children combo keys.
std::map<std::vector<std::string>,
std::vector<std::vector<std::vector<std::string> > > > _relations;
void GetComboKeys(const std::string& parCatName,
const unsigned int maxKeyGroup, ISTable& keysTable,
std::vector<std::vector<std::string> >& comboKeys,
std::vector<std::string>& parKeys);
virtual void GetParentCifItems(std::vector<std::string>& parCifItems,
const std::string& cifItemName) = 0;
void AddParentCategoryToItemLinkedGroup(ISTable& itemLinkedGroup,
ISTable& itemLinkedGroupList);
void CreateAllRelations(ISTable& itemLinkedGroup,
ISTable& itemLinkedGroupList);
void ISTableFindPairs(std::map<std::string,
std::vector<std::vector<std::string> > >& childrenKeys,
const std::vector<std::string>& parKeys, ISTable& itemLinkedGroupList);
void UpdateMap(std::map<std::string,
std::vector<std::vector<std::string> > >& childrenKeys,
const std::string& childCat, std::vector<std::string>& childKeys);
void UpdateParComboKeys(const std::string& parName,
std::vector<std::string>& parKeys);
void UpdateRelations(std::vector<std::string>& parKeys,
std::vector<std::vector<std::string> >& comboKeys);
bool KeysMatch(const std::vector<std::string>& firstKey,
const std::vector<std::string>& secondKey);
};
#endif
ParentChild::GetLinkGroupIdLabel
void GetLinkGroupIdLabel(std::string &linkGroupIdLabel, const std::vector< std::string > &parKeys, const std::vector< std::string > &childKeys)
ParentChild::AddParentCategoryToItemLinkedGroup
void AddParentCategoryToItemLinkedGroup(ISTable &itemLinkedGroup, ISTable &itemLinkedGroupList)
ISTable
Public class that respresents a two-dimensional table of strings.
Definition: ISTable.h:53
ParentChild::_relations
std::map< std::vector< std::string >, std::vector< std::vector< std::vector< std::string > > > > _relations
Definition: ParentChild.h:60
ISTable.h
Header file for ISTable class.
ParentChild::UpdateRelations
void UpdateRelations(std::vector< std::string > &parKeys, std::vector< std::vector< std::string > > &comboKeys)
ParentChild::UpdateMap
void UpdateMap(std::map< std::string, std::vector< std::vector< std::string > > > &childrenKeys, const std::string &childCat, std::vector< std::string > &childKeys)
ParentChild::GetParentCifItems
virtual void GetParentCifItems(std::vector< std::string > &parCifItems, const std::string &cifItemName)=0
ParentChild::IsParKeyPresent
bool IsParKeyPresent(const std::vector< std::string > &parKey, const std::string &childCatName)
ParentChild::_parComboKeys
std::map< std::string, std::vector< std::vector< std::string > > > _parComboKeys
Definition: ParentChild.h:56
ParentChild::_groupListTableP
ISTable * _groupListTableP
Definition: ParentChild.h:51
ParentChild::UpdateParComboKeys
void UpdateParComboKeys(const std::string &parName, std::vector< std::string > &parKeys)
ParentChild::CreateAllRelations
void CreateAllRelations(ISTable &itemLinkedGroup, ISTable &itemLinkedGroupList)
ParentChild::_groupTableP
ISTable * _groupTableP
Definition: ParentChild.h:50
ParentChild::ISTableFindPairs
void ISTableFindPairs(std::map< std::string, std::vector< std::vector< std::string > > > &childrenKeys, const std::vector< std::string > &parKeys, ISTable &itemLinkedGroupList)
ParentChild::GetChildrenKeys
std::vector< std::vector< std::vector< std::string > > > & GetChildrenKeys(const std::vector< std::string > &parComboKey)
ParentChild::ParentChild
ParentChild()
ParentChild::KeysMatch
bool KeysMatch(const std::vector< std::string > &firstKey, const std::vector< std::string > &secondKey)
ParentChild::~ParentChild
virtual ~ParentChild()
ParentChild
Definition: ParentChild.h:25
ParentChild::IsInParentComboKeys
bool IsInParentComboKeys(const std::string &itemName)
ParentChild::GetComboKeys
const std::vector< std::vector< std::string > > & GetComboKeys(const std::string &catName)
ParentChild::GetParents
void GetParents(std::vector< std::vector< std::string > > &parParKeys, std::vector< std::vector< std::string > > &comboComboKeys, const std::string &childCat)