TOC PREV NEXT INDEX


Message Buffer Classes


Message buffer classes describe the memory buffers into which XML message are encoded or from which XML messages are decoded. The main base class for all memory buffer derivations is OSRTMessageBufferIF. This is a pure virtual class that defines the interface all derived message buffer or stream classes must implement.
The base class for all in-memory message buffers is OSRTMessageBuffer. This too is abstract. It is used as the base for the OSXMLMessageBuffer class which is the base class for XML message encoding or decoding. From this, concrete XML encode (OSXMLEncodeBuffer) and decode (OSXMLDecodeBuffer) buffer classes are derived.
To encode an XML message, a user would need to describe the target buffer to which it is to be written. This is what the OSXMLEncodeBuffer class is used for. The default constructor allows a dynamic buffer to be setup that the encoder will manage the memory for to ensure there is enough space for a given encode operation to succeed. Another constructor is available that allows a fixed-sized buffer to be specified by providing the start address and buffer size. If this buffer is not large enough to hold a given encoded message, a buffer overflow error is returned from the encode method that is using the buffer.
To decode an XML message, it must first be described to the decoder. The OSXMLDecodeBuffer class can be used for this purpose. A message can be decoded directly from a file or memory input stream object. Constructors are available for specifying each of these inputs.

Copyright © Objective Systems 2002-2008
This document may be distributed in any form, electronic or otherwise, provided that it is distributed in its entirety and that the copyright and this notice are included.

Objective Systems, Inc.

55 Dowlin Forge Road
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com

TOC PREV NEXT INDEX