RWvostream RWvios RWreqostream RWios
CORBA Tools: CORBA Streaming Classes (orb library)
#include <rw/toolpro/orbstrea.h> CORBA::Request &req = ...; RWreqostream orbOStream(req);
orb, tls (and possibly std)
Class RWreqostream is an output stream used to write an object's state to a CORBA::Request object. Class RWreqostream encapsulates the CORBA::Request insertion routines.
Class RWreqostream provides the capability to write all the standard data types and vectors of those data types from an object into a CORBA::Request. RWreqostream can be interrogated as to the status of the stream using the following member functions, inherited from the Tools.h++ class RWvios: bad(), clear(), eof(), fail(), good(), and rdstate().
ORB streams are used in conjunction with the IONA Orbix opaque mechanism. In order for a C++ object to be passed as an opaque type, the developer must write extraction and insertion operations for that object from and to a CORBA::Request. The implementation of the insertion operator can use RWreqostream to write the object's state to the CORBA::Request.
The example that follows shows the implementation of the insertion operators required to write the state of an object to a CORBA::Request. These operators must pass an object as an opaque type in an IDL operation.
Say, for example, there is a user-defined type called Telemetry. Assuming that the developer has already written an insertion operator for Telemetry to an RWvostream with the following signature:
RWvostream &operator<<(RWvostream &, const Telemetry &);
The CORBA::Request insertion functions would then appear as follows:
#include <rw/toolpro/orbstrea.h> CORBA::Request &operator<<(CORBA::Request &req, const Telemetry *t) { RWreqostream orbStream(req); (RWvostream &)orbStream << *t; return req; } CORBA::Request &operator<<(CORBA::Request &req, Telemetry *&t) { RWreqostream orbStream(req); (RWvostream &)orbStream << *t; delete t; return req; }
Note that under normal circumstances, whenever using the CORBA streaming classes you do not need to write these functions yourself. The expansion of the RWDEFINE_OPAQUE or RWDEFINE_OPAQUE_COLLECTABLE macro creates these functions for you.
RWreqostream(CORBA::Request &req);
Initialize an RWreqostream with the CORBA::Request &req.
virtual RWvostream& operator<<(const char* s);
Redefined from class RWvostream. Stores the character string starting at s to the CORBA::Request object. The character string is expected to be null terminated.
virtual RWvostream& operator<<(char c);
Redefined from class RWvostream. Stores the character c to the CORBA::Request object. Note: c is treated as a character, not a number.
virtual RWvostream& operator<<(wchar_t wc);
Redefined from class RWvostream. Stores the wide character wc to the CORBA::Request object. Note: wc is treated as a character, not a number.
virtual RWvostream& operator<<(unsigned char c);
Redefined from class RWvostream. Stores the unsigned character c to the CORBA::Request object. Note: c is treated as a character, not a number.
virtual RWvostream& operator<<(double d);
Redefined from class RWvostream. Stores the double d to the CORBA::Request object.
virtual RWvostream& operator<<(float f);
Redefined from class RWvostream. Stores the float f to the CORBA::Request object.
virtual RWvostream& operator<<(int i);
Redefined from class RWvostream. Stores the integer i to the CORBA::Request object.
virtual RWvostream& operator<<(unsigned int i);
Redefined from class RWvostream. Stores the unsigned integer i to the CORBA::Request object.
virtual RWvostream& operator<<(long l);
Redefined from class RWvostream. Stores the long l to the CORBA::Request object.
virtual RWvostream& operator<<(unsigned long l);
Redefined from class RWvostream. Stores the unsigned long l to the CORBA::Request object.
virtual RWvostream& operator<<(short s);
Redefined from class RWvostream. Stores the short s to the CORBA::Request object.
virtual RWvostream& operator<<(unsigned short s);
Redefined from class RWvostream. Stores the unsigned short s to the CORBA::Request object.
virtual RWvostream& put(char c);
Redefined from class RWvostream. Stores the character c to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(unsigned char c);
Redefined from class RWvostream. Stores the unsigned character c to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(wchar_t wc);
Redefined from class RWvostream. Stores the wide character wc to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const char* p, size_t N);
Redefined from class RWvostream. Stores the vector of characters starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const wchar_t* p, size_t N);
Redefined from class RWvostream. Stores the vector of wide characters starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const short* p, size_t N);
Redefined from class RWvostream. Stores the vector of shorts starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const unsigned short* p, size_t N);
Redefined from class RWvostream. Stores the vector of unsigned shorts starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const int* p, size_t N);
Redefined from class RWvostream. Stores the vector of integers starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const unsigned int* p, size_t N);
Redefined from class RWvostream. Stores the vector of unsigned integers starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const long* p, size_t N);
Redefined from class RWvostream. Stores the vector of longs starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const unsigned long* p, size_t N);
Redefined from class RWvostream. Stores the vector of unsigned longs starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const float* p, size_t N);
Redefined from class RWvostream. Stores the vector of floats starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
virtual RWvostream& put(const double* p, size_t N);
Redefined from class RWvostream. Stores the vector of doubles starting at p to the CORBA::Request object. If the operation fails, it sets the failbit.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.