RWObjectOutputStream Class Reference
[Serialization]
Handle class for all the object output stream implementation classes.
More...
#include <rw/serial/RWObjectOutputStream.h>
List of all members.
Detailed Description
Handle class for all the object output stream implementation classes. Implements the handle idiom from the handle/body pattern. With the exception of constructors and assignment operators, all member functions forward directly to the implementation associated with this handle during construction.
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
| body | The stream implementation to associate with this handle. |
Copy constructor. Throws no exceptions.
- Parameters:
-
| handle | A data stream handle used to initialize the newly created handle. |
Member Function Documentation
void RWObjectOutputStream::closeContext |
( |
bool |
writeContext = true |
) |
[inline] |
void RWObjectOutputStream::endAssoc |
( |
|
) |
[inline] |
Called by the output operators for association types after each value.
void RWObjectOutputStream::endBlock |
( |
|
) |
[inline] |
Causes tokens to be output that identify the end of an object.
void RWObjectOutputStream::endElement |
( |
|
) |
[inline] |
Called by the output operators for collection types after each element in a sequence.
void RWObjectOutputStream::endMap |
( |
|
) |
[inline] |
Called by the output operators for association types after all the pairs.
void RWObjectOutputStream::endMember |
( |
const RWSymbol & |
memberName |
) |
[inline] |
Called by streamContents()
after each data member is written.
- Parameters:
-
| memberName | Identifies the name of the member. |
void RWObjectOutputStream::endParent |
( |
|
) |
[inline] |
Causes tokens to be output that identify the end of an parent class.
void RWObjectOutputStream::endSequence |
( |
|
) |
[inline] |
Called by the output operators for collection types at the end of a sequence.
bool RWObjectOutputStream::needToWrite |
( |
const void * |
obj |
) |
[inline] |
Returns true
when the referenced object has not yet been written to the stream in the current context. Otherwise, tokens are output identifying this object as a previously streamed one, and the function returns false
.
void RWObjectOutputStream::newObjectMarker |
( |
|
) |
[inline] |
Output is a token indicating that an object will be created by the factory.
void RWObjectOutputStream::openContext |
( |
bool |
writeContext = true |
) |
[inline] |
Writes a long double
value to the stream.
- Parameters:
-
| value | The long double value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a long long
value to the stream.
- Parameters:
-
| value | The long long value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a wchar_t
value to the stream.
- Parameters:
-
| value | The wchar_t value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a bool
value to the stream.
- Parameters:
-
| value | The bool value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a double
value to the stream.
- Parameters:
-
| value | The double value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a float
value to the stream.
- Parameters:
-
| value | The float value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes an unsigned long
value to the stream.
- Parameters:
-
| value | The unsigned long value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a long
value to the stream.
- Parameters:
-
| value | The long value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes an unsigned int
value to the stream.
- Parameters:
-
| value | The unsigned int value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes an int
value to the stream.
- Parameters:
-
| value | The int value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes an unsigned short
value to the stream.
- Parameters:
-
| value | The unsigned short to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a short
value to the stream.
- Parameters:
-
| value | The short to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a signed char
value to the stream.
- Parameters:
-
| value | The signed char value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes an unsigned char
value to the stream.
- Parameters:
-
| value | The unsigned char value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Writes a char
value to the stream.
- Parameters:
-
| value | The char value to be written to the stream. |
Reimplemented from RWDataOutputStream.
Assignment operator. Throws no exceptions.
- Parameters:
-
| handle | A data stream handle used to initialize this handle. |
void RWObjectOutputStream::putString |
( |
const std::string & |
str |
) |
[inline] |
Writes a std::string to the stream.
void RWObjectOutputStream::putString |
( |
const RWCString & |
str |
) |
[inline] |
void RWObjectOutputStream::putSymbol |
( |
const RWSymbol & |
sym |
) |
[inline] |
void RWObjectOutputStream::putUString |
( |
const RWBasicUString & |
str |
) |
[inline] |
void RWObjectOutputStream::putWString |
( |
const RWWString & |
str |
) |
[inline] |
void RWObjectOutputStream::rememberObject |
( |
const void * |
obj |
) |
[inline] |
Called by streaming operators to record each instance streamed out, in case it is referenced again in the same context.
- Parameters:
-
| obj | Holds the address of the instance. |
void RWObjectOutputStream::setNameForNextObject |
( |
const RWCString & |
instanceName |
) |
[inline] |
Sets up the instance name for the next object to be written out.
void RWObjectOutputStream::startAssocKey |
( |
|
) |
[inline] |
Called by the output operators for association types before each key.
void RWObjectOutputStream::startAssocValue |
( |
|
) |
[inline] |
Called by the output operators for association types after each key and before each value.
void RWObjectOutputStream::startBlock |
( |
const RWSymbol & |
typeInfo |
) |
[inline] |
Causes tokens to be output that identify the start of a new object.
- Parameters:
-
| typeInfo | Identifies the type of the new object, if such information is available. |
void RWObjectOutputStream::startElement |
( |
int |
position |
) |
[inline] |
Called by the output operators for collection types before each element in a sequence.
- Parameters:
-
| position | Contains the position of the element. |
Called by the output operators for association types (hash tables, etc.) at the start.
- Parameters:
-
| count | Contains the number of items in the association. |
| keyType | Contains the type of key in the association. |
| valueType | Contains the type of value in the association. |
| typeInfo | Contains the type of the association(collection) itself |
void RWObjectOutputStream::startParent |
( |
const RWSymbol & |
typeInfo |
) |
[inline] |
Causes tokens to be output that identify the start of a parent class.
- Parameters:
-
| typeInfo | Identifies the type of the parent class, if such information is available. |
void RWObjectOutputStream::startSequence |
( |
int |
count, |
|
|
RWStreamType |
elementType, |
|
|
const RWSymbol & |
typeInfo | |
|
) |
| | [inline] |
Called by the output operators for collection types at the start of a sequence.
- Parameters:
-
| count | Contains the number of items in the collection. |
| elementType | Contains the type of element in the collection. |
| typeInfo | Contains the type of the collection itself. |
void RWObjectOutputStream::writeMemberInfo |
( |
const RWSymbol & |
memberName, |
|
|
RWStreamType |
memberType | |
|
) |
| | [inline] |
Called for before each data member by the streamContents()
function. Metadata about the field may or may not be written to the stream, depending on the implementation. This function returns true
if data is actually written out. Otherwise, it returns false
.
- Parameters:
-
| memberName | Identifies the name of the member. |
| memberType | Identifies the type of the member. |
void RWObjectOutputStream::writeNullPtr |
( |
|
) |
[inline] |
Output is a token representing a null pointer.
void RWObjectOutputStream::writeTypeInfo |
( |
const RWSymbol & |
typeInfo |
) |
[inline] |
Outputs the type information required to factory an object of the correct dynamic type (derived class) on input.
- Parameters:
-
| typeInfo | Identifies the type of the new object, if such information is available. |