#include <IOManager.h>
Inheritance diagram for Sct::IOManager:
Methods for Streamable implementors | |
| |
virtual void | writeImpl (OStream &out, const Streamable &ob, bool writeClassName) const |
Writes a Streamable to an output stream. | |
virtual shared_ptr< Streamable > | readImpl (IStream &in) const |
Read a Streamable from an input stream. | |
virtual shared_ptr< Streamable > | readImpl (IStream &in, const string &className) const |
Read a Streamable from an input stream. | |
virtual void | readImpl (IStream &in, Streamable &ob, bool readClassName) const |
Read a Streamable from an input stream. | |
virtual void | writeClassName (OStream &out, const string &className) const |
Writes a class name to an OStream. | |
virtual string | readClassName (IStream &in) const |
Read a class name from an IStream. | |
bool | addToMap (const std::string &className, std::auto_ptr< Streamer > s) throw () |
Add a Streamer to the map. | |
Methods for sub-class authors | |
| |
typedef map< string, shared_ptr< Streamer > > | StreamerMap |
virtual Streamer & | getStreamer (const string &className) const |
A sub-class can override this if it wants to influence the Streamer that will be used for a particular class. | |
StreamerMap & | getMap () throw () |
Public Member Functions | |
virtual | ~IOManager () |
Methods for users | |
{ | |
virtual void | write (const Serializable &ob, const IOParams *params=0) const=0 |
Write an object. | |
virtual shared_ptr< Serializable > | read (const string &name, const IOParams *params=0) const=0 |
Read an object. |
Possibilities are raw file, IS, some other form of persistency. Perhaps even a viewer.
Some methods here deal with a name. This is a backend specific identifier - e.g. a filename or an IS name. In order to retrieve a name, a backend specific method or an appropriate IOName sub-class should be used.
shared_ptr is returned sometimes, rather than auto_ptr to allow singletons to be returned which might be indicated by some numeric ID for instance.
Definition at line 43 of file IOManager.h.
|
Definition at line 153 of file IOManager.h. |
|
Definition at line 45 of file IOManager.h. |
|
Add a Streamer to the map. The Streamer will be used to do IO on classes named className.
Definition at line 16 of file IOManager.cpp. References Sct::StreamerMap. |
|
Definition at line 24 of file IOManager.cpp. References Sct::StreamerMap. Referenced by getStreamer(). |
|
A sub-class can override this if it wants to influence the Streamer that will be used for a particular class.
Definition at line 29 of file IOManager.cpp. References getMap(), and Sct::StreamerMap. Referenced by readImpl(), and writeImpl(). |
|
Read an object. Will determine the class by first reading a string assumed to contain the className.
Implemented in Sct::File::IOManagerFile, and Sct::IS::IOManagerIS. |
|
Read a class name from an IStream. Should only be overriden if absolutely necessary. Sub-classes should use this method if ever they need to write a class name and avoid proprietry solutions as they may break Java compatability.
Definition at line 82 of file IOManager.cpp. Referenced by readImpl(). |
|
Read a Streamable from an input stream.
Definition at line 63 of file IOManager.cpp. References Sct::Streamable::getClassName(), getStreamer(), Sct::Streamer::read(), and readClassName(). |
|
Read a Streamable from an input stream. Corresponds to write with writeClassName=false.
Definition at line 58 of file IOManager.cpp. References getStreamer(), and Sct::Streamer::read(). |
|
Read a Streamable from an input stream. Reads the class name from the stream first. Corresponds to write with writeClassName=true.
Definition at line 52 of file IOManager.cpp. References getStreamer(), Sct::Streamer::read(), and readClassName(). Referenced by Sct::IS::detail::ISAdapter::refreshGuts(). |
|
Write an object.
Implemented in Sct::File::IOManagerFile, Sct::IS::IOManagerIS, and Sct::ISProxy::IOManagerISProxy. |
|
Writes a class name to an OStream. Should only be overriden if absolutely necessary. Sub-classes should use this method if ever they need to write a class name and avoid proprietry solutions as they may break Java compatability.
Definition at line 78 of file IOManager.cpp. Referenced by writeImpl(). |
|
Writes a Streamable to an output stream.
Reimplemented in Sct::ISProxy::IOManagerISProxy. Definition at line 46 of file IOManager.cpp. References Sct::Streamable::getClassName(), getStreamer(), Sct::Streamer::write(), and writeClassName(). Referenced by Sct::IS::detail::ISAdapter::publishGuts(). |