Class Index Cross Index Namespace Index

Class FrameCPP::Version_3_4_5::Dictionary

Frame Object Dictionary
Contained in: FrameCPP::Version_3_4_5
Derived from: none
Derived by: none

#include "../../../../../lib/framecpp/src/Version3_4_5/dictionary.hh"


public function member index:

Dictionary(int version); Constructor.
inline Dictionary::iterator begin(); Returns an iterator at the beginning of the dictionary.
inline Dictionary::const_iterator begin() const; Returns a constant iterator at the beginning of the dictionary.
inline Dictionary::iterator end(); Returns an iterator at the end of the dictionary.
inline Dictionary::const_iterator end() const; Returns a constant iterator at the end of the dictionary.
inline void erase(iterator start, iterator finish); Erase elements within a range.
inline void erase(iterator pos); Erase an element.
inline void erase(INT_2U classId); Erase an element with the specified ID.
void erase(const std::string& name); Erase the element with the given class name.
iterator find(INT_2U classId); Find an element by class ID.
const_iterator find(INT_2U classId) const; Find an element by class ID.
iterator find(const std::string& name); Find an element by class name.
const_iterator find(const std::string& name) const; Find an element by class name.
int getVersion() const; Return frame data format version
inline bool insert(const SH& sh, ReadPointer read); Inserts a Structure Header with its read pointer into the dictionary.
Base* readElement(Input& in, INT_2U classId) const; Call the read function for the class with the given ID.
Base* readElement(Input& in, const std::string& name) const; Call the read function for the class with the given name.
void registerClass(const SH& sh, ReadPointer read); Registers a structure header and read method with the Dictionary.
void registerClass(); Registers a frame class with the dictionary.
inline void registerVer3Class(); Registers a frame spec vesion 3 class with the dictionary.
inline void registerVer4Class(); Registers a frame spec vesion 4 class with the dictionary.
inline unsigned int size() const; The number of elements in the dictionary.
 

Description:

Dictonary stores the dictionary elements for the recognized frame classes. In addition, the Dictionary also stores a pointer to the read methods for these classes.

This static class loads itself with this information when it is constructed.

The class is used by the Output object to write structure headers & elements. It is used by the Input object to identify structures on the input stream and to locate the proper read method with which to load them.


Function Member Descriptions:


FrameCPP::Version_3_4_5::Dictionary::Dictionary - Constructor.


Dictionary(int version);
This method initializes the dictionary by registering all of the frame class objects (those which are written as structures to a frame file).

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed in initialization.
read_failureRead failed.



FrameCPP::Version_3_4_5::Dictionary::begin - Returns an iterator at the beginning of the dictionary.


inline Dictionary::iterator begin();

Return value:
iterator- An iterator pointing to the beginning of the dictionary.

Exceptions:
ExceptionDescription
None.
None.



FrameCPP::Version_3_4_5::Dictionary::begin - Returns a constant iterator at the beginning of the dictionary.


inline Dictionary::const_iterator begin() const;

Return value:
const_iterator- A constant iterator pointing to the beginning of the dictionary.

Exceptions:
ExceptionDescription
None.
None.



FrameCPP::Version_3_4_5::Dictionary::end - Returns an iterator at the end of the dictionary.


inline Dictionary::iterator end();

Return value:
iterator- An iterator pointing to the end of the dictionary.

Exceptions:
ExceptionDescription
None.
None.



FrameCPP::Version_3_4_5::Dictionary::end - Returns a constant iterator at the end of the dictionary.


inline Dictionary::const_iterator end() const;

Return value:
const_iterator- A constant iterator pointing to the end of the dictionary.

Exceptions:
ExceptionDescription
None.
None.



FrameCPP::Version_3_4_5::Dictionary::erase - Erase elements within a range.


inline void erase(iterator start, iterator finish);
Erases all of the dictionary elements between two iterators: [start,finish). If finish is < start then the result is undefined.

Parameters:
ParameterDescription
iterator startThe first element to delete.
iterator finishThe final element, it is not deleted.

Exceptions:
ExceptionDescription
None.
None.



FrameCPP::Version_3_4_5::Dictionary::erase - Erase an element.


inline void erase(iterator pos);

Parameters:
ParameterDescription
iterator posThe element to delete. If this is out-of-range then the behavior is undefined.

Exceptions:
ExceptionDescription
None.
None.



FrameCPP::Version_3_4_5::Dictionary::erase - Erase an element with the specified ID.


inline void erase(INT_2U classId);

Parameters:
ParameterDescription
INT_2U classIdThe ID of the element to erase. If the ID doesn't
exist then nothingerased.

Exceptions:
ExceptionDescription
None.
None.



FrameCPP::Version_3_4_5::Dictionary::erase - Erase the element with the given class name.


void erase(const std::string& name);
If the name doesn't exist then nothing is erased. If multiple classes exist with the same name then only the first is removed.

Parameters:
ParameterDescription
const std::string& nameThe name of the element to remove.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::Dictionary::find - Find an element by class ID.


iterator find(INT_2U classId);

Parameters:
ParameterDescription
INT_2U classIdThe ID of the desired element.

Return value:
iterator- The iterator for the desired element. This is end() if the ID didn't exist.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::Dictionary::find - Find an element by class ID.


const_iterator find(INT_2U classId) const;

Parameters:
ParameterDescription
INT_2U classIdThe ID of the desired element.

Return value:
const_iterator- The iterator for the desired element. This is end() if the ID didn't exist.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::Dictionary::find - Find an element by class name.


iterator find(const std::string& name);
If more than one element exists with the same name this will only return an iterator to the first element.

Parameters:
ParameterDescription
const std::string& nameThe name of the desired element.

Return value:
iterator- The iterator for the desired element. This is end() if the name didn't exist.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::Dictionary::find - Find an element by class name.


const_iterator find(const std::string& name) const;
If more than one element exists with the same name this will only return an iterator to the first element.

Parameters:
ParameterDescription
const std::string& nameThe name of the desired element.

Return value:
const_iterator- The iterator for the desired element. This is end() if the name didn't exist.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::Dictionary::getVersion - Return frame data format version


int getVersion() const;

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::Dictionary::insert - Inserts a Structure Header with its read pointer into the dictionary.


inline bool insert(const SH& sh, ReadPointer read);
If a structure header with the same class ID already exists in the dictionary then nothing will be added and the method will return false.

Parameters:
ParameterDescription
const SH& shthe structure header to add.
ReadPointer rpA pointer to the read function which whould be used to read this class.

Return value:
bool- True if the data was inserted, false if a structure header with the same Class ID already exists in the dictionary (the data will not be inserted).

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.
std::bad_allocMemory allocation failed during insertion.



FrameCPP::Version_3_4_5::Dictionary::readElement - Call the read function for the class with the given ID.


Base* readElement(Input& in, INT_2U classId) const;

Parameters:
ParameterDescription
Input& inThe Input object to read from.
INT_2U classIdThe ID of the class to read.

Return value:
Base*- The pointer to the instantiated object. The memory for this object is allocated by this method, the user is responsible for destructing this object. If the the class ID could not be found this will be NULL.

Exceptions:
ExceptionDescription
not_found_errorData is not found.
read_failureRead failed.



FrameCPP::Version_3_4_5::Dictionary::readElement - Call the read function for the class with the given name.


Base* readElement(Input& in, const std::string& name) const;

Parameters:
ParameterDescription
Input& inThe Input object to read from.
const std::string& nameThe name of the class to read.

Return value:
Base*- The pointer to the instantiated object. The memory for this object is allocated by this method, the user is responsible for destructing this object. If the the class ID could not be found this will be NULL.

Exceptions:
ExceptionDescription
not_found_errorData is not found.
read_failureRead failed.



FrameCPP::Version_3_4_5::Dictionary::registerClass - Registers a structure header and read method with the Dictionary.


void registerClass(const SH& sh, ReadPointer read);

Parameters:
ParameterDescription
const SH& shStructure header.
ReadPointer readRead method.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::Dictionary::registerClass - Registers a frame class with the dictionary.


void registerClass();
This method inserts information about a frame class into the Dictionary. The frame class must define the following two methods: 1. static SH getSH() - A method returning the Structure Header for the class. 2. static T* read( FrameReaderBase& ) - The read method for the class.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed during the insertion.



FrameCPP::Version_3_4_5::Dictionary::registerVer3Class - Registers a frame spec vesion 3 class with the dictionary.


inline void registerVer3Class();

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::Dictionary::registerVer4Class - Registers a frame spec vesion 4 class with the dictionary.


inline void registerVer4Class();
This method inserts information about a frame class into the Dictionary. The frame class must define the following two methods: 1. static SH getSH() - A method returning the Structure Header for the class. 2. static T* read( FrameReaderBase& ) - The read method for the class.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed during the insertion.



FrameCPP::Version_3_4_5::Dictionary::size - The number of elements in the dictionary.


inline unsigned int size() const;

Return value:
unsigned int- The number of elements in the dictionary.

Exceptions:
ExceptionDescription
None.
None.



Variable Member Descriptions:


FrameCPP::Version_3_4_5::Dictionary::mInfo -

std::map< INT_2U, ClassInfo > mInfo;

FrameCPP::Version_3_4_5::Dictionary::mVersion - Frame data format version described by this dictionary

int mVersion;