DictObjFile Class Reference

Public class that represents a dictionary object file. More...

#include <DictObjFile.h>

Collaboration diagram for DictObjFile:

Collaboration graph
[legend]
List of all members.

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)
DictObjContGetDictObjCont (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

Detailed Description

Public class that represents a dictionary object file.

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.


Constructor & Destructor Documentation

DictObjFile::DictObjFile ( const string &  persStorFileName,
const string &  dicFileName = String::Empty,
const string &  ddlFileName = String::Empty,
const bool  verbose = false 
)

Constructs a dictionary object file.

Parameters:
[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.
Returns:
Not applicable
Precondition:
None
Postcondition:
None
Exceptions:
 None

DictObjFile::DictObjFile ( const string &  persStorFileName,
const bool  verbose 
)

Constructs a dictionary object file, which content will be retrieved from the persistent storage file.

Parameters:
[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.
Returns:
Not applicable
Precondition:
None
Postcondition:
None
Exceptions:
 None

DictObjFile::~DictObjFile (  ) 

Destructs a dictionary object file, by releasing all consumed resources.

Parameters:
 Not applicable
Returns:
Not applicable
Precondition:
None
Postcondition:
None
Exceptions:
 None


Member Function Documentation

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.

Parameters:
 None
Returns:
None
Precondition:
None
Postcondition:
None
Exceptions:
 None

void DictObjFile::Write (  ) 

Writes a dictionary object file to the persistent storage file.

Parameters:
 None
Returns:
None
Precondition:
None
Postcondition:
None
Exceptions:
 None

void DictObjFile::Read (  ) 

Reads a dictionary object file from the persistent storage file.

Parameters:
 None
Returns:
None
Precondition:
None
Postcondition:
None
Exceptions:
 None

unsigned int DictObjFile::GetNumDictionaries (  ) 

Retrieves the number of dictionaries in the dictionary object file.

Parameters:
 None
Returns:
The number of dictionaries in the dictionary object file.
Precondition:
None
Postcondition:
None
Exceptions:
 None

void DictObjFile::GetDictionaryNames ( vector< string > &  dictNames  ) 

Retrieves dictionary names of the dictionaries in the dictionary object file.

Parameters:
[out] dictNames - retrieved dictionary names
Returns:
None
Precondition:
None
Postcondition:
None
Exceptions:
 None

DictObjCont & DictObjFile::GetDictObjCont ( const string &  dictName  ) 

Retrieves a reference to the dictionary object.

Parameters:
[in] dictName - dictionary name
Returns:
Reference to the dictionary object.
Precondition:
Dictionary with name dictName must be present
Postcondition:
None
Exceptions:
NotFoundException - if dictionary with name dictName does not exist

void DictObjFile::Print (  ) 

Prints the content of the dictionary object file.

Parameters:
 None
Returns:
None
Precondition:
None
Postcondition:
None
Exceptions:
 None

void DictObjFile::Init (  )  [private]


Member Data Documentation

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]


The documentation for this class was generated from the following files:
Generated on Wed Feb 6 09:44:18 2008 for dict-obj-file-v8.0 by  doxygen 1.5.1