Class Index | Cross Index | Namespace Index |
Input
Contained in: FrameCPP::Version_3_4_5
Derived from:
none
Derived by:
FrameCPP::Version_3_4_5::DaqFrame
FrameCPP::Version_3_4_5::FrameReaderBase
#include "../../../../../lib/framecpp/src/Version3_4_5/input.hh"
public function member index: |
|||
Input | (std::istream* in=0, FileHeader* fh=0); | Constructor | |
virtual | ~Input | (); | Destructor |
inline void | clearErrors | (); | Clear the errors |
inline Input::error_iterator | errorBegin | () const; | Error Begin |
inline Input::error_iterator | errorEnd | () const; | Error End |
inline const std::string& | errorFirst | () const; | Get first error |
inline const std::string& | errorLast | () const; | Get last error |
inline unsigned int | errorQuantity | () const; | Error Quantity |
inline INT_2U | getDataFormatVersion | () const; | Get frame file data format vesion |
inline const std::string& | getError | (unsigned int index) const; | Get an error |
inline INT_4U | getNBytes | () const; | Get Number of Bytes Read |
inline Input& | operator >> | (CHAR& v); | Read a CHAR |
inline Input& | operator >> | (CHAR_U& v); | Read a CHAR_U |
inline Input& | operator >> | (INT_2S& v); | Read an INT_2S |
inline Input& | operator >> | (INT_2U& v); | Read an INT_2U |
inline Input& | operator >> | (INT_4S& v); | Read an INT_4S |
inline Input& | operator >> | (INT_4U& v); | Read an INT_4U |
inline Input& | operator >> | (INT_8S& v); | Read an INT_8S |
inline Input& | operator >> | (INT_8U& v); | Read an INT_8U |
inline Input& | operator >> | (REAL_4& v); | Read an REAL_4 |
inline Input& | operator >> | (REAL_8& v); | Read an REAL_8 |
Input& | operator >> | (std::string& v); | Read a STRING. |
void | read | (void*, unsigned int n); | Read Bytes |
virtual ObjectHeader | readNextObjectHeader | (); | Get next object header. |
void | reset | (); | Reset the Input object |
void | setErrorWatch | (void(*f)(const std::string&)); | Set an Error Watch |
void | skip | (unsigned int n); | Skip bytes |
inline void | skipCurrentObject | (); | Skip the length of the current object header |
protected function member index: |
|||
void | addError | (const std::string& msg); | Add an Error |
private function member index: |
|||
void | (*mErrorWatch); | ||
void | endDictionaryElement | (); | Finish a Dictionary Element |
void | readStructureElement | (INT_4U length); | Read a Structure Element |
void | readStructureHeader | (); | Read Structure Header (Dictionary Element) |
An instance of this class is constructed with an istream object. When
the user performs the first read request, the Input class attempts to read
the File Header, once this is loaded then the read is processed.
Creates an input object which reads the passed stream.
Parameters:
Parameter | Description |
istream& in | The stream to read. |
FileHeader* fh | Optional file header. |
Exceptions:
Exception | Description |
None. |
We only need to delete the FileHeader.
Parameters:
Parameter | Description |
const strin& msg | Error message. |
Exceptions:
Exception | Description |
None. |
Exceptions:
Exception | Description |
None. | |
None. |
This closes a dictionary element and adds a translation entry to the translation map (this map stores a mapping between file class ID's and local class ID's).
Get an iterator pointing to the first iterator.
Return value:
error_iterator
Exceptions:
Exception | Description |
None. | |
None. |
Get an iterator pointing immediately past the last iterator.
Return value:
error_iterator
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
const std::string&
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
const std::string&
Exceptions:
Exception | Description |
None. | |
None. |
Get the number of errors.
Return value:
unsigned int
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
INT_2U- input frame data format version or 0 if not read yet
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
unsigned int index | Error index. |
Return value:
const std::string&- Error message.
Exceptions:
Exception | Description |
std::range_error | |
std::range_error | Thrown if the requested error index does not exist. |
Return value:
INT_4U- The number of bytes read.
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
CHAR& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failed. |
Parameters:
Parameter | Description |
CHAR_U& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failure occured. |
Parameters:
Parameter | Description |
INT_2S& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failed. |
Parameters:
Parameter | Description |
INT_2U& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read fialure occured. |
Parameters:
Parameter | Description |
INT_4S& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failure occured. |
Parameters:
Parameter | Description |
INT_4U& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failure occured. |
Parameters:
Parameter | Description |
INT_8S& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failure occured. |
Parameters:
Parameter | Description |
INT_8U& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failure occured. |
Parameters:
Parameter | Description |
REAL_4& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failure occured. |
Parameters:
Parameter | Description |
REAL_8& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failure occured. |
Parameters:
Parameter | Description |
std::string& v | Target. |
Return value:
Input&- This object.
Exceptions:
Exception | Description |
read_failure | String read failed. |
Parameters:
Parameter | Description |
void* buffer | the location to store the bytes |
unsigned int n | The number of bytes to read |
Exceptions:
Exception | Description |
read_failure | Read failed. |
This returns the object header for the next item in the frame file. This method skips over structure headers and structure elements, storing their information.
Exceptions:
Exception | Description |
read_failure | Read failed. |
Parameters:
Parameter | Description |
INT_4U length | the length of the structure element. This is needed in case this is a stray structure element, in which case the structure element will be skipped. |
Exceptions:
Exception | Description |
read_failure | Read failed. |
This method reads a structure header. the object header must have already been read.
Exceptions:
Exception | Description |
read_failure | Read failed. |
This causes the input object to re-read the fileheader from the stream when the next frame is read.
Exceptions:
Exception | Description |
None. |
An error watch is a method which is called whenever an error is added to the Input class.
Parameters:
Parameter | Description |
void (*f)(const std::string&) | The function to call when an error occurs. If this is null, then no function will be called. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
unsigned int length | The number of bytes to skip. |
Exceptions:
Exception | Description |
read_failure | Read failed. |
Exceptions:
Exception | Description |
read_failure | Read failed. |
read_failure | Read failed. |