activemq-cpp-3.6.0
activemq::wireformat::stomp::StompFrame Class Reference

A Stomp-level message frame that encloses all messages to and from the broker. More...

#include <src/main/activemq/wireformat/stomp/StompFrame.h>

Public Member Functions

 StompFrame ()
 Default constructor.
virtual ~StompFrame ()
 Destruction.
StompFrameclone () const
 Clonse this message exactly, returns a new instance that the caller is required to delete.
void copy (const StompFrame *src)
 Copies the contents of the passed Frame to this one.
void setCommand (const std::string &cmd)
 Sets the command for this stomp frame.
const std::string & getCommand () const
 Accessor for this frame's command field.
bool hasProperty (const std::string &name) const
 Checks if the given property is present in the Frame.
std::string getProperty (const std::string &name, const std::string &fallback="") const
 Gets a property from this Frame's properties and returns it, or the default value given.
std::string removeProperty (const std::string &name)
 Gets and remove the property specified, if the property is not set, this method returns the empty string.
void setProperty (const std::string &name, const std::string &value)
 Sets the property given to the value specified in this Frame's Properties.
decaf::util::PropertiesgetProperties ()
 Gets access to the header properties for this frame.
const decaf::util::PropertiesgetProperties () const
const std::vector< unsigned
char > & 
getBody () const
 Accessor for the body data of this frame.
std::vector< unsigned char > & getBody ()
 Non-const version of the body accessor.
std::size_t getBodyLength () const
 Return the number of bytes contained in this frames body.
void setBody (const unsigned char *bytes, std::size_t numBytes)
 Sets the body data of this frame as a byte sequence.
void toStream (decaf::io::DataOutputStream *stream) const
 Writes this Frame to an OuputStream in the Stomp Wire Format.
void fromStream (decaf::io::DataInputStream *stream)
 Reads a Stop Frame from a DataInputStream in the Stomp Wire format.

Detailed Description

A Stomp-level message frame that encloses all messages to and from the broker.

Constructor & Destructor Documentation

activemq::wireformat::stomp::StompFrame::StompFrame ( )

Default constructor.

virtual activemq::wireformat::stomp::StompFrame::~StompFrame ( )
virtual

Destruction.

Member Function Documentation

StompFrame* activemq::wireformat::stomp::StompFrame::clone ( ) const

Clonse this message exactly, returns a new instance that the caller is required to delete.

Returns
new copy of this message
void activemq::wireformat::stomp::StompFrame::copy ( const StompFrame src)

Copies the contents of the passed Frame to this one.

Parameters
src- Frame to copy
void activemq::wireformat::stomp::StompFrame::fromStream ( decaf::io::DataInputStream stream)

Reads a Stop Frame from a DataInputStream in the Stomp Wire format.

Parameters
stream- The stream to read the Frame from.
Exceptions
IOExceptionif an error occurs while writing the Frame.
const std::vector<unsigned char>& activemq::wireformat::stomp::StompFrame::getBody ( ) const
inline

Accessor for the body data of this frame.

Returns
char pointer to body data
std::vector<unsigned char>& activemq::wireformat::stomp::StompFrame::getBody ( )
inline

Non-const version of the body accessor.

std::size_t activemq::wireformat::stomp::StompFrame::getBodyLength ( ) const
inline

Return the number of bytes contained in this frames body.

Returns
Body bytes length.
const std::string& activemq::wireformat::stomp::StompFrame::getCommand ( ) const
inline

Accessor for this frame's command field.

decaf::util::Properties& activemq::wireformat::stomp::StompFrame::getProperties ( )
inline

Gets access to the header properties for this frame.

Returns
the Properties object owned by this Frame
const decaf::util::Properties& activemq::wireformat::stomp::StompFrame::getProperties ( ) const
inline
std::string activemq::wireformat::stomp::StompFrame::getProperty ( const std::string &  name,
const std::string &  fallback = "" 
) const
inline

Gets a property from this Frame's properties and returns it, or the default value given.

Parameters
name- The name of the property to lookup
fallback- The default value to return if this value isn't set
Returns
string value of the property asked for.
bool activemq::wireformat::stomp::StompFrame::hasProperty ( const std::string &  name) const
inline

Checks if the given property is present in the Frame.

Parameters
name- The name of the property to check for.
std::string activemq::wireformat::stomp::StompFrame::removeProperty ( const std::string &  name)
inline

Gets and remove the property specified, if the property is not set, this method returns the empty string.

Parameters
name- the Name of the property to get and return.
void activemq::wireformat::stomp::StompFrame::setBody ( const unsigned char *  bytes,
std::size_t  numBytes 
)

Sets the body data of this frame as a byte sequence.

Parameters
bytesThe byte buffer to be set in the body.
numBytesThe number of bytes in the buffer.
void activemq::wireformat::stomp::StompFrame::setCommand ( const std::string &  cmd)
inline

Sets the command for this stomp frame.

Parameters
cmdcommand The command to be set.
void activemq::wireformat::stomp::StompFrame::setProperty ( const std::string &  name,
const std::string &  value 
)
inline

Sets the property given to the value specified in this Frame's Properties.

Parameters
name- Name of the property.
value- Value to set the property to.
void activemq::wireformat::stomp::StompFrame::toStream ( decaf::io::DataOutputStream stream) const

Writes this Frame to an OuputStream in the Stomp Wire Format.

Parameters
stream- The stream to write the Frame to.
Exceptions
IOExceptionif an error occurs while reading the Frame.

The documentation for this class was generated from the following file: