Archive Class
The Archive class is a "smart pointer" wrapper for an ArchiveI interface pointer.
Examples
- List all the channels in an archive (BinArchive in this case):
#include<BinArchive.h> #include<ArchiveException.h> int main(int argc, const char argv[]) { try { Archive archive(new BinArchive(argv[1])); ChannelIterator channel(archive); archive.findFirstChannel(channel); while (channel) { cout << channel->getName() << endl; ++ channel; } } catch (ArchiveException &e) { cout << "Error: " << e.what() << "\n"; } return 0; }- Find channels that match a given regular expression:
ChannelIterator channel(archive); archive.findChannelByPattern ("Input[0-9]", channel); ...
See ChannelIterator about access to values.
All methods might throw an ArchiveException.Interface
- Set ChannelIterator on first channel. Iterator allows access to next channel, but not necessarily sorted (Hash Table).
bool findFirstChannel (ChannelIterator &channel);- Find channel by exact name (fast since using Hash Table)
bool findChannelByName (const stdString &name, ChannelIterator &channel);- Find first channel that matches given pattern. If pattern is empty, findFirstChannel() will be called.
bool findChannelByPattern (const stdString ®ular_expression, ChannelIterator &channel);- Create a value suitable for the given DbrType/Count
ValueI *newValue (DbrType type, DbrCount count);
IndexCreated from sources with MakeDoc Perl script.