#include <DictObjFile.h>
Collaboration diagram for DictObjFile:
Public Member Functions | |
DictObjFile (const string &persStorFileName, const string &dicFileName=String::Empty, const string &ddlFileName=String::Empty, const bool verbose=false) | |
DictObjFile (const string &persStorFileName, const bool verbose) | |
~DictObjFile () | |
void | Build () |
void | Write () |
void | Read () |
unsigned int | GetNumDictionaries () |
void | GetDictionaryNames (vector< string > &dictNames) |
DictObjCont & | GetDictObjCont (const string &dictName) |
void | Print () |
Private Member Functions | |
void | Init () |
Private Attributes | |
bool | _verbose |
string | _ddlFileName |
string | _dicFileName |
string | _serFileName |
DdlFile & | _ddlFile |
DicFile & | _dicFile |
Serializer & | _ser |
mapped_ptr_vector< DictObjCont > | _dictionaries |
DictObjCont * | _currDictObjContP |
This class represents a dictionary object file. This file is a container of dictionary objects. Each dictionary object is a container of its attributes and of objects of type: item, sub-category and category. Each of those objects is a container of relevant attributes for that object type. This class provides methods for construction/destruction, building the dictionary object file from a dictionary, writing/reading dictionary object file to/from the persistent storage file, accessing the dictionaries and printing the content of the dictionary object file.
DictObjFile::DictObjFile | ( | const string & | persStorFileName, | |
const string & | dicFileName = String::Empty , |
|||
const string & | ddlFileName = String::Empty , |
|||
const bool | verbose = false | |||
) |
Constructs a dictionary object file.
[in] | persStoreFileName | - relative or absolute name of the persistent storage file |
[in] | dicFileName | - optional parameter that indicates relative or absolute name of the dictionary file. If not specified, the dictionary object file content is retrieved from the persistent storage file. Otherwise its content will be built from the file specified by this parameter. |
[in] | dicFileName | - optional parameter that indicates relative or absolute name of the DDL file for the dictionary. This parameter is relevant only if dicFileName is specified. |
[in] | verbose | - optional parameter that indicates whether logging should be turned on (if true) or off (if false). If verbose is not specified, logging is turned off. |
None |
DictObjFile::DictObjFile | ( | const string & | persStorFileName, | |
const bool | verbose | |||
) |
Constructs a dictionary object file, which content will be retrieved from the persistent storage file.
[in] | persStoreFileName | - relative or absolute name of the persistent storage file |
[in] | verbose | - optional parameter that indicates whether logging should be turned on (if true) or off (if false). If verbose is not specified, logging is turned off. |
None |
DictObjFile::~DictObjFile | ( | ) |
Destructs a dictionary object file, by releasing all consumed resources.
Not applicable |
None |
void DictObjFile::Build | ( | ) |
Builds a dictionary object file from the dictionary. This method parses the dictionary, parses the DDL, verifies the dictionary against the DDL and constructs objects.
None |
None |
void DictObjFile::Write | ( | ) |
Writes a dictionary object file to the persistent storage file.
None |
None |
void DictObjFile::Read | ( | ) |
Reads a dictionary object file from the persistent storage file.
None |
None |
unsigned int DictObjFile::GetNumDictionaries | ( | ) |
Retrieves the number of dictionaries in the dictionary object file.
None |
None |
void DictObjFile::GetDictionaryNames | ( | vector< string > & | dictNames | ) |
Retrieves dictionary names of the dictionaries in the dictionary object file.
[out] | dictNames | - retrieved dictionary names |
None |
DictObjCont & DictObjFile::GetDictObjCont | ( | const string & | dictName | ) |
Retrieves a reference to the dictionary object.
[in] | dictName | - dictionary name |
NotFoundException | - if dictionary with name dictName does not exist |
void DictObjFile::Print | ( | ) |
Prints the content of the dictionary object file.
None |
None |
void DictObjFile::Init | ( | ) | [private] |
bool DictObjFile::_verbose [private] |
string DictObjFile::_ddlFileName [private] |
string DictObjFile::_dicFileName [private] |
string DictObjFile::_serFileName [private] |
DdlFile& DictObjFile::_ddlFile [private] |
DicFile& DictObjFile::_dicFile [private] |
Serializer& DictObjFile::_ser [private] |
mapped_ptr_vector<DictObjCont> DictObjFile::_dictionaries [private] |
DictObjCont* DictObjFile::_currDictObjContP [private] |