#include <Message_AMOS.hh>
Public Methods | |
| Message_t () | |
| Constructs an empty Message_t. | |
| ~Message_t () | |
| Destroys a Message_t object. | |
| void | clear () |
| Clears the message. | |
| bool | exists (NCode_t fcode) const |
| Checks for the existence of a field by NCode. | |
| bool | exists (const std::string &fname) const |
| Checks for the existence of a field by name. | |
| const std::string & | getField (NCode_t fcode) const |
| Gets field data by field NCode. | |
| const std::string & | getField (const std::string &fname) const |
| Gets field data by field name. | |
| const std::vector< Message_t > & | getSubMessages () const |
| Get a the vector of submessages for this message. | |
| std::vector< Message_t > & | getSubMessages () |
| Get a the vector of submessages for this message. | |
| NCode_t | getMessageCode () const |
| Get the NCode type of this message. | |
| bool | read (std::istream &in) |
| Read a message from an input stream. | |
| void | removeField (NCode_t fcode) |
| Removes a field from the message object by NCode. | |
| void | removeField (const std::string &fname) |
| Removes a field from the message object. | |
| void | setSubMessages (const std::vector< Message_t > &subs) |
| Set the vector of submessages for this message. | |
| void | setField (NCode_t fcode, const std::string &data) |
| Set field data by field NCode. | |
| void | setField (const std::string &fname, const std::string &data) |
| Set field data by field name. | |
| void | setMessageCode (NCode_t mcode) |
| Set the NCode type code of this message. | |
| void | setMessageCode (const std::string &mname) |
| Set the NCode type name of this message. | |
| void | write (std::ostream &out) const |
| Write the message object to an output stream. | |
Static Public Methods | |
| NCode_t | skip (std::istream &in) |
| Skips a message in an input stream, returning its NCode. | |
Based on the Celera 3-code format, the AMOS 'NCode' messages are designed for easy parsing and compatibility with the other AMOS modules. This generic message class makes no assumptions about the type of data to be stored within, so it can be used for reading and writing ANY type of ASCII record in NCode format. The main duty of this class is to understand and validate incoming or outgoing NCode format.
|
|
Constructs an empty Message_t.
|
|
|
Destroys a Message_t object.
|
|
|
Clears the message.
|
|
|
Checks for the existence of a field by name.
|
|
|
Checks for the existence of a field by NCode.
|
|
|
Gets field data by field name. Will return the field data, or throws an exception if the field does not exist. You can check if the field exists first with the exists method.
|
|
|
Gets field data by field NCode. Will return the field data, or throws an exception if the field does not exist. You can check if the field exists first with the exists method.
|
|
|
Get the NCode type of this message. Will return M_NULL if the message has not been assigned a type name yet. NCode can be decoded to a string with the 'AMOS::Decode' function.
|
|
|
Get a the vector of submessages for this message.
|
|
|
Get a the vector of submessages for this message.
|
|
|
Read a message from an input stream. Reads a message from an input stream and populates the message fields with the values read from the stream. Will throw an exception if a message is found, but is not properly formatted.
|
|
|
Removes a field from the message object. Removes a field from the message. Has no effect if the field name does not exist or is improperly formatted.
|
|
|
Removes a field from the message object by NCode. Removes a field from the message by its NCode. Has no effect if the field code does not exist.
|
|
||||||||||||
|
Set field data by field name. Will set a new, or overwrite and existing field with the supplied data. Throws an exception for an improperly formatted 3-code field name or an improperly formated data record (i.e. a multi-line record that does not end in a newline).
|
|
||||||||||||
|
Set field data by field NCode. Will set a new, or overwrite and existing field with the supplied data. Throws an exception for an improperly formatted data record (i.e. a multi-line record that does not end in a newline). If the data string is empty, the field will be ignored and will remain uninitialized.
|
|
|
Set the NCode type name of this message. Will throw an exception if the name is improperly formatted.
|
|
|
Set the NCode type code of this message.
|
|
|
Set the vector of submessages for this message.
|
|
|
Skips a message in an input stream, returning its NCode. Skips a message in an input stream, returning its NCode. Will throw an exception if a message is found, but its message code or nesting is not properly formatted. This validation is not entirely sound, and message errors may slip through unnoticed.
|
|
|
Write the message object to an output stream. Writes the NCode ASCII representation of this object to the supplied output stream. Will throw an exception if there was an error trying to write to the stream.
|
1.3-rc2