|
|
#ifndef OM_STREAM_H #define OM_STREAM_H /** * Base class for streams. * * This class provides an encapsulation of the I/O needed by the library. * Inheriting this class can be very useful to properly and easily integrate * new kinds of I/O systems, though an underlying OMIO object from the C library * must be always available. * This class should not be inherited directly, but it is decomposed in two specific * classes for output and input that can be specialized. */ class OmStream { public: /** * Get the underlying OMIO object. */ virtual OMIO getIO() { OmException::checkNullPointer(io_); return io_; } protected: /** * Default constructor. The underlying OMIO object is initialized to 0 so it is necessary * for the descendant classes to set correctly this value as soon as possible. */ OmStream() : io_(0) {} /** * Destructor. The resources should be freed by the underlying C library when closing the device. */ virtual ~OmStream() {} /** * Set the new OMIO object. * @li Precondition: ~ NullPointer(io_in) */ virtual void setIO(OMIO io_in) { OmException::checkNullPointer(io_in); io_ = io_in; } private: OmStream(const OmStream &) {} void operator =(const OmStream &) {} private: OMIO io_; }; /** * Base class for output streams. * * This class provides a specializable stream for output operations. */ class OmOutputStream : public OmStream {}; /** * Base class for input streams. * * This class provides a specializable stream for input operations. */ class OmInputStream : public OmStream {}; #endif // OM_STREAM_H
Generated by: root@localhost.localdomain on Tue Oct 12 21:02:30 199. |