Visit Platform at http://www.platform.com

Main Page   Class Hierarchy   Compound List   Compound Members  

DefaultBinaryMessage Class Reference

A default implementation for a binary data message. More...

Inheritance diagram for DefaultBinaryMessage:

Message List of all members.

Public Methods

 DefaultBinaryMessage (void)
 Default constructor for the default binary message.

 DefaultBinaryMessage (const char *buffer, unsigned long length, bool shouldCopy=false)
 Additional constructor for the default binary message.

void onSerialize (OutputStreamPtr &stream) throw (SoamException)
 This method will be called during serialization of the message.

void onDeserialize (InputStreamPtr &stream) throw (SoamException)
 This method will be called during de-serialization of the message.

void setBuffer (const char *buffer, unsigned long length, bool shouldCopy=false)
 This method allows the developer to set the internal buffer within the message.

const char * getBuffer (unsigned long &length) const
 This method allows the developer to get the internal buffer from the message.


Detailed Description

A default implementation for a binary data message.

This represents a default implementation for developers requiring a convenient way to submit binary message without creating their own implementation. This object is not thread safe, therefore the developer is responsible for any synchronization required.

See also:
Message


Constructor & Destructor Documentation

DefaultBinaryMessage void   
 

Default constructor for the default binary message.

DefaultBinaryMessage const char *    buffer,
unsigned long    length,
bool    shouldCopy = false
 

Additional constructor for the default binary message.

the parameters exposed are exactly the same exposed by setBuffer().

See also:
DefaultBinaryMessage::setBuffer

Member Function Documentation

void onSerialize OutputStreamPtr   stream throw (SoamException) [virtual]
 

This method will be called during serialization of the message.

Parameters:
stream  [IN] - the stream to which the object is being serialized.
See also:
OutputStream

Implements Message.

void onDeserialize InputStreamPtr   stream throw (SoamException) [virtual]
 

This method will be called during de-serialization of the message.

Parameters:
stream  [IN] - the stream from which the object is being de-serialized.
See also:
InputStream

Implements Message.

void setBuffer const char *    buffer,
unsigned long    length,
bool    shouldCopy = false
 

This method allows the developer to set the internal buffer within the message.

Parameters:
buffer  [IN] - a pointer to a buffer to be associated with the message. If a null value is passed for this parameter all other parameters will be ignored and a buffer of length zero will be assumed.
length  [IN] - the expected length of the buffer to be associated with the message.
shouldCopy  [IN] - a boolean value specifying if a copy must be made of the buffer and stored internally within the message. The default value of "false" means that only the pointer to buffer will be stored within the message. In this case the developer is responsible for the management of the buffer outside of the message. If this value is set to true a copy of the buffer "length" bytes long will be managed by the message. In this case the internal copy will be released on destruction of the message.

const char* getBuffer unsigned long &    length const
 

This method allows the developer to get the internal buffer from the message.

Parameters:
length  [OUT] - the variable to accept the length of the buffer being returned.
Returns:
a pointer to the internal buffer. The buffer is managed by the message and should not be modified extenally.


     
Date Modified: 3 Nov 2008
Platform Support: support@platform.com
Platform Information Development: doc@platform.com

Platform Computing. Accelerating Intelligence(TM).
Copyright © 2001-2008 Platform Computing Corporation. All rights reserved.