#include <IOManagerStreamerVersioned.h>
Inheritance diagram for Sct::Archive::IOManagerStreamerVersioned:
Public Member Functions | |
virtual Streamer & | getStreamer (const string &className) const |
Over-ride of getStreamer returns appropriate version of streamer if in read mode, otherwise default IOManager::getStreamer. | |
virtual void | readImpl (IStream &in, Streamable &ob, bool bReadClassName) const |
over-ride readImpl to read classnames and versions | |
virtual shared_ptr< Streamable > | readImpl (IStream &in) const |
over-ride readImpl to read classnames and versions | |
virtual shared_ptr< Streamable > | readImpl (IStream &in, const std::string &className) const |
over-ride readImpl to read classnames and versions | |
virtual void | writeImpl (OStream &out, const Streamable &ob, bool bWriteClassName) const |
over-ride writeImpl to write classname and version | |
virtual void | readImpl (IStream &in, Streamable &ob, const std::string &className) const |
over-ride readImpl to read classnames and versions | |
virtual void | writeImpl (OStream &out, const Streamable &ob, const std::string &className) const |
over-ride writeImpl to write classname and version | |
Protected Types | |
typedef std::map< std::string, unsigned > | VersionMap |
Protected Member Functions | |
IOManagerStreamerVersioned () | |
Public access is through instance(). | |
virtual void | writeClassName (OStream &, const string &classname) const |
override to write class and version to OStream uses writeClassName | |
virtual std::string | readClassName (IStream &) const |
override to read version from IStream and put in map. | |
boost::recursive_mutex & | getMutex () const |
concrete implimentations must lock this mutex when doing read or write, so that read or write mode cannot be changed by other threads. | |
void | setReadMode (bool mode) const |
set read mode to true when reading, false when writing. | |
bool | readMode () const |
get read mode - true if reading, false if writing. | |
Static Protected Member Functions | |
static VersionMap & | getReadVersionMap () |
Map of streamer versions to use for each classname. | |
Private Attributes | |
boost::recursive_mutex | m_access |
access must be locked for thread-safeness. | |
bool | m_read_mode |
if true will use its own verion map to get appropriate streamers. |
When writing, the appropriate (i.e. current) streamer versions are written out. When reading the file, the streamer versions are first read, and then the getStreamer() method overriden to return the historic streamers. In write mode the most recent (default) streamers are always returned. Concrete versions must get a lock on the mutex, and setReadMode(true) at start of read. Similarly they must get a lock on the mutex and setReadMode(false) at the start of a write.
Definition at line 22 of file IOManagerStreamerVersioned.h.
|
Public access is through instance().
Definition at line 12 of file IOManagerStreamerVersioned.cpp. |
|
concrete implimentations must lock this mutex when doing read or write, so that read or write mode cannot be changed by other threads.
Definition at line 135 of file IOManagerStreamerVersioned.cpp. References m_access. Referenced by SctArchiving::IOManagerDB::read(), readMode(), Sct::Archive::IOManagerArchive::setCompressionLevel(), setReadMode(), SctArchiving::IOManagerDB::write(), and Sct::Archive::IOManagerArchiveFile::write(). |
|
Map of streamer versions to use for each classname.
Definition at line 15 of file IOManagerStreamerVersioned.cpp. Referenced by getStreamer(), SctArchiving::IOManagerDB::read(), Sct::Archive::IOManagerArchiveFile::read(), and readClassName(). |
|
Over-ride of getStreamer returns appropriate version of streamer if in read mode, otherwise default IOManager::getStreamer.
Reimplemented from Sct::IOManager. Definition at line 101 of file IOManagerStreamerVersioned.cpp. References getReadVersionMap(), Sct::SctNames::Mrs(), and readMode(). Referenced by readImpl(), and writeImpl(). Here is the call graph for this function: ![]() |
|
override to read version from IStream and put in map. uses readClassName
Reimplemented from Sct::IOManager. Definition at line 28 of file IOManagerStreamerVersioned.cpp. References getReadVersionMap(), Sct::IOManager::readClassName(), and setReadMode(). Referenced by readImpl(). Here is the call graph for this function: ![]() |
|
over-ride readImpl to read classnames and versions
Definition at line 44 of file IOManagerStreamerVersioned.cpp. References getStreamer(), Sct::Streamer::read(), readClassName(), and setReadMode(). Here is the call graph for this function: ![]() |
|
over-ride readImpl to read classnames and versions
|
|
over-ride readImpl to read classnames and versions
Reimplemented from Sct::IOManager. Definition at line 87 of file IOManagerStreamerVersioned.cpp. References getStreamer(), Sct::Streamer::read(), readClassName(), and setReadMode(). Here is the call graph for this function: ![]() |
|
over-ride readImpl to read classnames and versions
Reimplemented from Sct::IOManager. Definition at line 61 of file IOManagerStreamerVersioned.cpp. References Sct::Streamable::getClassName(), readClassName(), and setReadMode(). Referenced by SctArchiving::IOManagerDB::read(). Here is the call graph for this function: ![]() |
|
get read mode - true if reading, false if writing. nothrow. Definition at line 131 of file IOManagerStreamerVersioned.cpp. References getMutex(), and m_read_mode. Referenced by getStreamer(). Here is the call graph for this function: ![]() |
|
set read mode to true when reading, false when writing. nothrow Definition at line 126 of file IOManagerStreamerVersioned.cpp. References getMutex(), and m_read_mode. Referenced by SctArchiving::IOManagerDB::read(), Sct::Archive::IOManagerArchiveFile::read(), readClassName(), readImpl(), SctArchiving::IOManagerDB::write(), Sct::Archive::IOManagerArchiveFile::write(), writeClassName(), and writeImpl(). Here is the call graph for this function: ![]() |
|
override to write class and version to OStream uses writeClassName
Reimplemented from Sct::IOManager. Definition at line 20 of file IOManagerStreamerVersioned.cpp. References Sct::IOManager::getMapName(), Sct::IOManager::getStreamer(), Sct::Streamer::getVersion(), setReadMode(), and Sct::IOManager::writeClassName(). Referenced by writeImpl(). Here is the call graph for this function: ![]() |
|
over-ride writeImpl to write classname and version
Definition at line 55 of file IOManagerStreamerVersioned.cpp. References getStreamer(), setReadMode(), Sct::Streamer::write(), and writeClassName(). Here is the call graph for this function: ![]() |
|
over-ride writeImpl to write classname and version
Reimplemented from Sct::IOManager. Definition at line 94 of file IOManagerStreamerVersioned.cpp. References Sct::Streamable::getClassName(), getStreamer(), setReadMode(), Sct::Streamer::write(), and writeClassName(). Referenced by SctArchiving::IOManagerDB::write(). Here is the call graph for this function: ![]() |
|
access must be locked for thread-safeness.
Definition at line 84 of file IOManagerStreamerVersioned.h. Referenced by getMutex(). |
|
if true will use its own verion map to get appropriate streamers.
Definition at line 85 of file IOManagerStreamerVersioned.h. Referenced by readMode(), and setReadMode(). |