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

Main Page   Class Hierarchy   Compound List   Compound Members  

DefaultByteArrayMessage Class Reference

A default implementation for a byte array message. More...

Inheritance diagram for DefaultByteArrayMessage:

Message List of all members.

Public Methods

 DefaultByteArrayMessage (void)
 Default constructor for the default byte array message. This represents a default implementation for developers requiring a convenient way to pass binary data between a client and a service without creating their own implementation. This object is not thread safe, therefore the developer is responsible for any synchronization required.

 DefaultByteArrayMessage (const void *byteArray, SoamUInt length, SoamBool shouldCopy=false)
 Additional constructor for the default byte array 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 setByteArray (const void *byteArray, SoamUInt length, SoamBool shouldCopy=false)
 This method allows the developer to set the internal byte array within the message.

void getByteArray (char *&byteArray, SoamUInt &length, SoamBool shouldCopy=false) const
 This method allows the developer to get the internal buffer from the message.


Detailed Description

A default implementation for a byte array message.

This represents a default implementation for developers requiring a convenient way to submit ByteArray message without creating their own implementation. This object is not thread safe, therefore the developer is responsible for any synchronization required. This message can be used in applications that have a "cross-platform" implementation. (i.e. client and service may be implemented in different supported languages)

NOTE: If any of the methods of this class are called after the main(...) method exits, the client or service process may behave in an undefined manner (for example, hang or terminate abnormally).

See also:
Message


Constructor & Destructor Documentation

DefaultByteArrayMessage void   
 

Default constructor for the default byte array message. This represents a default implementation for developers requiring a convenient way to pass binary data between a client and a service without creating their own implementation. This object is not thread safe, therefore the developer is responsible for any synchronization required.

DefaultByteArrayMessage const void *    byteArray,
SoamUInt    length,
SoamBool    shouldCopy = false
 

Additional constructor for the default byte array message.

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

See also:
DefaultByteArrayMessage::setByteArray

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 setByteArray const void *    byteArray,
SoamUInt    length,
SoamBool    shouldCopy = false
 

This method allows the developer to set the internal byte array within the message.

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

void getByteArray char *&    byteArray,
SoamUInt &    length,
SoamBool    shouldCopy = false
const
 

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

Parameters:
byteArray  [OUT] - a reference to a byte array pointer that will point to the internal buffer containing the array or a copy of the array itself.
length  [OUT] - the variable to accept the length of the buffer being returned.
shouldCopy  [IN] - a boolean value specifying if a copy must be made of the byte array. The default value of "false" means that the memory returned in the byteArray parameter should not be modified or freed. A value of "true" means that the memory returned must be freed by the caller. The delete operator should be used to free this memory.
for example;
    delete []byteArray;


     
Date Modified: 28 Apr 2011
Platform Support: support@platform.com
Platform Information Development: doc@platform.com

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