RWvistream RWvios RWreqistream RWios
CORBA Tools: CORBA Streaming Classes (orb library)
#include <rw/toolpro/orbstrea.h> CORBA::Request &req = ...; RWreqistream orbIStream(req);
orb, tls (and possibly std)
Class RWreqistream is an input stream used to read an object's state from a CORBA::Request object. Class RWreqistream encapsulates the CORBA::Request extraction routines.
Class RWreqistream provides the capability to read all the standard data types and vectors of those data types from the CORBA::Request into an object. RWreqistream can be interrogated about 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 make use of RWreqistream to read in the object's state from the CORBA::Request.
The example that follows shows the implementation of the extraction operator required to read the state of an object from a CORBA::Request. This operator must pass an object as an opaque type in an IDL operation.
Say, for example, there is a user-defined type called Telemetry. Suppose that the developer has already written an extraction operator for Telemetry from an RWvistream with the following signature:
RWvistream &operator>>(RWvistream &, Telemetry &);
The CORBA::Request extraction function would then appear as follows:
#include <rw/toolpro/orbstrea.h> CORBA::Request &operator>>(CORBA::Request &req, Telemetry *&t) { RWreqistream orbStream(req); t = new Telemetry; (RWvistream &)orbStream >> *t; return req; }
Note that under normal circumstances, whenever using the CORBA streaming classes you do not need to write this function yourself. The expansion of the RWDEFINE_OPAQUE or RWDEFINE_OPAQUE_COLLECTABLE macro creates this function for you.
RWreqistream(CORBA::Request &req);
Initializes an RWreqistream with the CORBA::Request &req.
virtual int get();
Redefined from class RWvistream. Gets and returns the next character from the CORBA::Request object. If the operation fails, it sets the failbit and returns EOF.
virtual RWvistream& get(char& c);
Redefined from class RWvistream. Gets the next character from the CORBA::Request object and stores it in c. If the operation fails, it sets the failbit.
virtual RWvistream& get(wchar_t& wc);
Redefined from class RWvistream. Gets the next wide character from the CORBA::Request object and stores it in wc. If the operation fails, it sets the failbit.
virtual RWvistream& get(unsigned char& c);
Redefined from class RWvistream. Gets the next unsigned character from the CORBA::Request object and stores it in c. If the operation fails, it sets the failbit.
virtual RWvistream& get(char* v, size_t N);
Redefined from class RWvistream. Gets a vector of N characters from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(unsigned char* v, size_t N);
Redefined from class RWvistream. Gets a vector of unsigned characters from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(double* v, size_t N);
Redefined from class RWvistream. Gets a vector of doubles from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(float* v, size_t N);
Redefined from class RWvistream. Gets a vector of floats from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(int* v, size_t N);
Redefined from class RWvistream. Gets a vector of integers from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(unsigned int* v, size_t N);
Redefined from class RWvistream. Gets a vector of unsigned integers from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(long* v, size_t N);
Redefined from class RWvistream. Gets a vector of longs from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(unsigned long* v, size_t N);
Redefined from class RWvistream. Gets a vector of unsigned longs from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(short* v, size_t N);
Redefined from class RWvistream. Gets a vector of shorts from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(unsigned short* v, size_t N);
Redefined from class RWvistream. Gets a vector of unsigned shorts from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& get(wchar_t* v, size_t N);
Redefined from class RWvistream. Gets a vector of wide characters from the CORBA::Request object and stores it in v. If the operation fails, it sets the failbit.
virtual RWvistream& getString(char* s, size_t maxlen);
Redefined from class RWvistream. Restores a character string from the CORBA::Request object and stores it in the array starting at s. The function stops reading at the end of the string or after maxlen-1 characters, whichever comes first. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(char& c );
Redefined from class RWvistream. Gets the next character from the CORBA::Request object and stores it in c. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(double& d);
Redefined from class RWvistream. Gets the next double from the CORBA::Request object and stores it in d. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(float& f);
Redefined from class RWvistream. Gets the next float from the CORBA::Request object and stores it in f. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(int& i);
Redefined from class RWvistream. Gets the next integer from the CORBA::Request object and stores it in i. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(long& l);
Redefined from class RWvistream. Gets the next long from the CORBA::Request object and stores it in l. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(short& s);
Redefined from class RWvistream. Gets the next short from the CORBA::Request object and stores it in s. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(wchar_t& wc);
Redefined from class RWvistream. Gets the next wide character from the CORBA::Request object and stores it in wc. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(unsigned char& c);
Redefined from class RWvistream. Gets the next unsigned character from the CORBA::Request object and stores it in c. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(unsigned int& i);
Redefined from class RWvistream. Gets the next unsigned integer from the CORBA::Request object and stores it in i. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(unsigned long& l);
Redefined from class RWvistream. Gets the next unsigned long from the CORBA::Request object and stores it in l. If the operation fails, it sets the failbit.
virtual RWvistream& operator>>(unsigned short& s);
Redefined from class RWvistream. Gets the next unsigned short from the CORBA::Request object and stores it in s. If the operation fails, it sets the failbit.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.