ArchiveI Class
The ArchiveI class is the top-level interface to the ChannelArchiver data files.Like ChannelIteratorI, ValueIteratorI etc. this class defines an interface.
You cannot instantiate an ArchiveI class but only obtain a pointer to one from a factory class that implements the actual routines.
- BinArchive handles access to the original, binary data format.
- MultiArchive allows simultaneous read-access to multiple archives
Client programs might prefer to use the "smart pointer" Archive instead of the raw ArchiveI interface pointer.
Multiple, Simultaneous Access
The ChannelArchiver API is not thread-safe, additional semaphores are needed for multi-threaded access.
Within a single thread, multiple archives can be used. For each Archive, more than one CLASS ChannelIterator can be obtained. For each ChannelIterator, a single ValueIterator can be used. This allows to read multiple channels from many archives at once. To access values for the same channel from different points in time, multiple ChannelIterators (each set to the same channel) must be used.
Interface
- Factory methods to create archive-specific iterators and values,
See ChannelIteratorI, ValueIteratorI, ValueI.virtual ChannelIteratorI *newChannelIterator () const = 0; virtual ValueIteratorI *newValueIterator () const = 0; virtual ValueI *newValue (DbrType type, DbrCount count) = 0;- Make Channel iterator point to first channel. (ChannelIteratorI has to exist, for creation see newChannelIterator() below)
virtual bool findFirstChannel (ChannelIteratorI *channel) = 0;- Find channel by exact name or regular expression pattern
virtual bool findChannelByName (const stdString &name, ChannelIteratorI *channel) = 0; virtual bool findChannelByPattern (const stdString ®ular_expression, ChannelIteratorI *channel) = 0;- Add new channel to archive (undefined behaviour if channel exists before, check with findChannelByName() to avoid problems)
virtual bool addChannel (const stdString &name, ChannelIteratorI *channel) = 0; };
IndexCreated from sources with MakeDoc Perl script.