Module: Advanced Tools Package: Serialization
RWObjectInputStream RWDataInputStream
#include <rw/serial/RWObjectInputStream.h>
RWObjectInputStream is the handle class for object input stream imp classes. Implements the handle idiom from the handle/body pattern. With the exception of constructors, assignment operators, and getFactory, all member functions forward directly to the implementation associated with this handle during construction.
RW_EXPLICIT RWObjectInputStream(RWObjectInputStreamImp* body);
Constructor.
Parameter List
body |
Stream implementation to associate with this handle. |
RWObjectInputStream(const RWObjectInputStream& handle);
Copy constructor. Throws no exceptions.
Parameter List
handle |
Data stream handle used to initialize the newly created handle. |
RWObjectInputStream& operator=(const RWObjectInputStream& handle);
Assignment operator. Throws no exceptions.
Parameter List
handle |
Data stream handle used to initialize this handle. |
bool startMember(RWSymbol& memberName, RWStreamType& memberType);
Called for before each data member by the streamContents() function. Metadata about the field may or may not be read from the stream depending on the implementation. If data is read, returns true and parameter memberName will contain the name of the member; otherwise returns false.
RWSymbol startBlock();
Causes tokens to be input that identify the start of a new object. Returns an RWSymbol representing the new object. Depending on the implementation class associated with this handle the RWSymbol may be empty.
RWSymbol startMap(int& count, RWStreamType& keyType,
RWStreamType& valueType);
Called by the input operators for association types (hash tables, etc.) at the start. Returns an RWSymbol representing the collection.
Parameter List
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. |
RWSymbol startSequence(int& count, RWStreamType& elementType);
Called by the input operators for collection types at the start of a sequence. Returns an RWSymbol representing the collection.
Parameter List
count |
Contains the number of items in the collection. |
elementType |
Contains the type of element in the collection. |
RWSymbol readTypeInfo();
Reads the type information for an class instance from the stream and returns it as a symbol.
static RWTCountingPointer<RWTFactory1<void*, RWCString, RWSymbol>, RWSafeCounter>& getFactory();
Obtains the singleton factory used to create objects dynamically from streams.
void closeContext(bool readContext = true);
Called by RWWithObjectInputContext dtor to close an open context.
void endAssoc();
Called by the input operators for association types after each value.
void endBlock();
Causes tokens to be input that identify the end of an object.
void endElement();
Called by the input operators for collection types after each element in a sequence.
void endMap();
Called by the input operators for association types after all the pairs.
void endMember();
Called by streamContents() after each data member is read.
void endParent();
Causes tokens to be input that identify the end of an parent class.
void endSequence();
Called by the input operators for collection types at the end of a sequence.
void* getNewObject(const type_info* base);
Reads the dynamic type information (derived class) from the input stream, and factories an instance of this type.
Parameter List
base |
the static type (base class) of the field being read |
void getString(RWCString& value);
Reads an RWCString value from the stream.
void getString(std::string& value);
Reads a std::string value from the stream.
void getUString(RWBasicUString& value);
Reads an RWBasicUString value from the stream.
Parameter List
value |
The RWBasicUString value to be read from the stream. |
void getWString(RWWString& value);
Reads an RWWString value from the stream.
Parameter List
value |
The RWWString value to be read from the stream. |
void getSymbol(RWSymbol& value);
Reads an RWSymbol value from the stream.
void openContext(bool readContext = true);
Called by RWWithObjectInputContext ctor to open a context in which multiple references to a single object are resolved.
void rememberObject(const void* obj);
Called by streaming operators to record each instance streamed in, in case it is referenced again in the same context.
void startAssocKey();
Called by the input operators for association types before each key.
void startAssocValue();
Called by the input operators for association types after each key and before each value.
void startElement(int& position);
Called by the input operators for collection types before each element in a sequence.
Parameter List
position |
Contains the position of the element in the collection. |
void startParent(const RWSymbol& typeInfo);
Causes tokens to be input that identify the start of a parent class.
Parameter List
typeInfo |
Identifies the type of the parent class, if such information is available. |
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.