Using infomation object tags

IS repository provides a way of keeping several versions of an infomation object in the IS repository. Each version has a unique 32-bit tag associated with it. Using tags it is possible to update, remove and read value of a specific version of an infomation object. The IS API, which provides this functionality, has been slightly changed with respect to the tdaq01-08-03(04) releases where it was itroduced for the first time.

Automatic tags assignment

When an infomation object is updated using the keep_history mode a new tag is automatically created and assigned to the new version of the object. The new tag is equal to the maximum tag value for the given object plus 1. This mode can be used by calling one of the following functions with the true value for the keep_history parameter:
ISInfoDictionary::update( const std::string & name, ISInfo & info, bool keep_history = false );
ISInfoDictionary::checkin( const std::string & name, ISInfo & info, bool keep_history = false );

ISNamedInfo::chekin( bool keep_history = false );
Note that the default value of the keep_history parameter is false which means that the old object version will be overwritten by a new one and the tag will remain unchanged.

Setting tags explicitely

It is possible to set new tags explicitely by using another form of the update (checkin) functions:
ISInfoDictionary::update( const std::string & name, int tag, ISInfo & info );
ISInfoDictionary::checkin( const std::string & name, int tag, ISInfo & info );

ISNamedInfo::chekin( int tag );
If the object version associated with the given tag alreasy exists in the repositopry then it will be replaced with the new one. Otherwise a new version will be created and associated with the given tag.

Reading objects with tags

There are two groups of functions which can be used for reading objects from the IS repostiory. The first group contains function which do not require tag value to be provided:
ISInfoDictionary::getValue( const std::string & name, ISInfo & info );
ISNamedInfo::chekout( );
These functions return the most recent value of the given infomation object.

Another group of functions require object tags to be explicitely provided:
ISInfoDictionary::getValue( const std::string & name, int tag, ISInfo & info );
ISNamedInfo::chekout( int tag );
These functions return the object value which is associated with the given tag. If there is no value for the given tag in the IS repository then daq::is::InfoNotFound exception will be thrown.