Class Index | Cross Index | Namespace Index |
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. |
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.
This method initializes the dictionary by registering all of the frame class objects (those which are written as structures to a frame file).
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed in initialization. |
read_failure | Read failed. |
Return value:
iterator- An iterator pointing to the beginning of the dictionary.
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
const_iterator- A constant iterator pointing to the beginning of the dictionary.
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
iterator- An iterator pointing to the end of the dictionary.
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
const_iterator- A constant iterator pointing to the end of the dictionary.
Exceptions:
Exception | Description |
None. | |
None. |
Erases all of the dictionary elements between two iterators: [start,finish). If finish is < start then the result is undefined.
Parameters:
Parameter | Description |
iterator start | The first element to delete. |
iterator finish | The final element, it is not deleted. |
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
iterator pos | The element to delete. If this is out-of-range then the behavior is undefined. |
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
INT_2U classId | The ID of the element to erase. If the ID doesn't |
exist then nothing | erased. |
Exceptions:
Exception | Description |
None. | |
None. |
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:
Parameter | Description |
const std::string& name | The name of the element to remove. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
INT_2U classId | The ID of the desired element. |
Return value:
iterator- The iterator for the desired element. This is end() if the ID didn't exist.
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
INT_2U classId | The 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:
Exception | Description |
None. |
If more than one element exists with the same name this will only return an iterator to the first element.
Parameters:
Parameter | Description |
const std::string& name | The name of the desired element. |
Return value:
iterator- The iterator for the desired element. This is end() if the name didn't exist.
Exceptions:
Exception | Description |
None. |
If more than one element exists with the same name this will only return an iterator to the first element.
Parameters:
Parameter | Description |
const std::string& name | The 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:
Exception | Description |
None. |
Exceptions:
Exception | Description |
None. |
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:
Parameter | Description |
const SH& sh | the structure header to add. |
ReadPointer rp | A 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:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
std::bad_alloc | Memory allocation failed during insertion. |
Parameters:
Parameter | Description |
Input& in | The Input object to read from. |
INT_2U classId | The 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:
Exception | Description |
not_found_error | Data is not found. |
read_failure | Read failed. |
Parameters:
Parameter | Description |
Input& in | The Input object to read from. |
const std::string& name | The 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:
Exception | Description |
not_found_error | Data is not found. |
read_failure | Read failed. |
Parameters:
Parameter | Description |
const SH& sh | Structure header. |
ReadPointer read | Read method. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
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:
Exception | Description |
std::bad_alloc | Memory allocation failed during the insertion. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
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:
Exception | Description |
std::bad_alloc | Memory allocation failed during the insertion. |
Return value:
unsigned int- The number of elements in the dictionary.
Exceptions:
Exception | Description |
None. | |
None. |