DictObjCont.h
Go to the documentation of this file.
/*$$FILE$$*/
/*$$VERSION$$*/
/*$$DATE$$*/
/*$$LICENSE$$*/
#ifndef DICTOBJCONT_H
#define DICTOBJCONT_H
#include <rcsb/mapped_ptr_vector.h>
#include <rcsb/mapped_ptr_vector.C>
#include <rcsb/DictObjContInfo.h>
#include <rcsb/DicFile.h>
class ObjCont
{
public:
ObjCont(Serializer& ser, DicFile& dicFile, const string& blockName,
const string& id, const ObjContInfo& objContInfo);
virtual ~ObjCont();
void Init();
const string& GetName() const;
virtual void Read(UInt32 which, unsigned int Index = 0);
virtual UInt32 Write();
const vector<string>& GetAttribute(const string& catName,
const string& itemName) const;
void Print() const;
void SetVerbose(bool verbose);
virtual void Build();
protected:
Serializer& _ser;
DicFile& _dicFile;
const ObjContInfo& _objContInfo;
string _blockName;
string _id;
bool _verbose;
vector<UInt32> _index;
vector<vector<vector<string> > > _itemsStore;
virtual void BuildItems(vector<vector<string> >& combo,
const unsigned int configIndex);
void BuildItems(vector<vector<string> >& combo,
const unsigned int configIndex, const string& value);
private:
void ReadItem(const pair<unsigned int, unsigned int>& indexPair,
unsigned int Index);
};
class ItemObjCont : public ObjCont
{
public:
ItemObjCont(Serializer& ser, DicFile& dicFile,
const string& blockName, const string& itemName);
~ItemObjCont();
void Build();
private:
vector<string> _decendency;
void GetItemDecendency();
void BuildItems(vector<vector<string> >& combo,
const unsigned int configIndex);
};
class DictObjCont : public ObjCont
{
public:
DictObjCont(Serializer& ser, DicFile& dicFile,
const string& blockName);
~DictObjCont();
void Build();
UInt32 Write();
void Read(UInt32 which, unsigned int Index = 0);
const ObjCont& GetObjCont(const string& contName,
const ObjContInfo& objContInfo) const;
void Print();
private:
mutable mapped_ptr_vector<ObjCont> _items;
mutable mapped_ptr_vector<ObjCont> _subcategories;
mutable mapped_ptr_vector<ObjCont> _categories;
DictObjCont(const DictObjCont& dictObjCont);
DictObjCont& operator=(const DictObjCont& inDictObjCont);
UInt32 WriteContLocations(const vector<UInt32>& indices);
void BuildContainers(unsigned int index, const string& catName,
const string& itemName, mapped_ptr_vector<ObjCont>& containers);
void BuildItems(vector<vector<string> >& combo,
const unsigned int configIndex);
ObjCont& GetContainers(const string& contName,
mapped_ptr_vector<ObjCont>& containers, const ObjContInfo& objContInfo)
const;
void PrintContainers(const string& catName,
const string& itemName, const ObjContInfo& objContInfo);
};
#endif // DICTOBJCONT_H
ObjCont
Public class that represents a generic object container.
Definition: DictObjCont.h:35
UInt32
unsigned int UInt32
Definition: rcsb_types.h:15
ObjCont::_objContInfo
const ObjContInfo & _objContInfo
Definition: DictObjCont.h:127
DicFile.h
Header file for DicFile class.
ObjCont::Init
void Init()
ObjCont::_itemsStore
vector< vector< vector< string > > > _itemsStore
Definition: DictObjCont.h:136
ObjCont::_id
string _id
Definition: DictObjCont.h:130
ObjCont::BuildItems
virtual void BuildItems(vector< vector< string > > &combo, const unsigned int configIndex)
ObjCont::ObjCont
ObjCont(Serializer &ser, DicFile &dicFile, const string &blockName, const string &id, const ObjContInfo &objContInfo)
ObjCont::_blockName
string _blockName
Definition: DictObjCont.h:129
ObjCont::_dicFile
DicFile & _dicFile
Definition: DictObjCont.h:125
ObjCont::Build
virtual void Build()
mapped_ptr_vector.C
ObjCont::SetVerbose
void SetVerbose(bool verbose)
ObjCont::Read
virtual void Read(UInt32 which, unsigned int Index=0)
ObjCont::~ObjCont
virtual ~ObjCont()
ObjCont::GetName
const string & GetName() const
mapped_ptr_vector.h
ObjCont::Print
void Print() const
ObjContInfo
Public class that represents a generic information class for the generic object container.
Definition: DictObjContInfo.h:39
ObjCont::_index
vector< UInt32 > _index
Definition: DictObjCont.h:134
DictObjContInfo.h
Header file for ObjContInfo, DictObjContInfo, CatObjContInfo, SubcatObjContInfo and ItemObjContInfo c...
ObjCont::_verbose
bool _verbose
Definition: DictObjCont.h:132
Serializer
Definition: Serializer.h:43
mapped_ptr_vector< ObjCont >
ItemObjCont
Private class that represents an item object container.
Definition: DictObjCont.h:158
ObjCont::_ser
Serializer & _ser
Definition: DictObjCont.h:123
ObjCont::Write
virtual UInt32 Write()
DictObjCont
Public class that represents a dictionary object container.
Definition: DictObjCont.h:201
ObjCont::GetAttribute
const vector< string > & GetAttribute(const string &catName, const string &itemName) const
DicFile
Public class that represents a dictionary file, composed of blocks with tables.
Definition: DicFile.h:36