15.11 ISInfoDynAny
ISInfo
#include <is/infodynany.h>
ISInfoDynAny isda;
This class is used to read and publish information whose type is unknown at compilation time. The class provides setter and getter template functions to read and modify values of individual information attributes.
1: #include "is/infodynany.h"
2:
3: IPCPartition partition( "MyPartition" );
4: ISInfoDynAny da;
5: ISInfoDictionary dict;
6: dict.getValue(name,da);
7: if (da.type().entryType(0) == ISType::s32)
8: da.getAttributeValue(0)=12345;
9: dict.checkin(name,da);
ISType::Basic
getAttributeType(size_t pos) const;
-
Returns type of the attribute at the given stream position. For the definition of the ISType::Basic enumeration see Chapter 15.19.
size_t
getAttributesNumber( ) const;
-
Returns a number of attributes for the information object.
const ISInfoDocument::Attribute &
getAttributeDescription(size_t pos) const;
-
Returns meta-information for the attribute at the given position. May throw daq::is::DocumentNotFound exception if the meta-information repository is not available or does not contain description of the this object type.
const ISInfoDocument::Attribute &
getAttributeDescription(const std::string & name) const;
-
Returns meta-information for the given attribute. May throw daq::is::DocumentNotFound exception if the meta-information repository is not available or does not contain description of the this object type. May also throw daq::is::AttributeNotFound if this object has no attribute with the given name.
template <class T>
const T &
getAttributeValue(size_t pos) const;
-
Returns the value of the attribute at the given position.
template <class T>
const T &
getAttributeValue(const std::string & name) const;
-
Returns the value of the attribute with the given name. May throw daq::is::AttributeNotFound if this object has no attribute with the given name.
template <class T>
T &
getAttributeValue(size_t pos);
-
Returns non-constant reference to the value of the attribute at the given position. This function can be used to modify an attribute value.
template <class T>
const T &
getAttributeValue(const std::string & name) const;
-
Returns non-constant reference to the value of the attribute with the given name. This function can be used to modify an attribute value. May throw daq::is::AttributeNotFound if this object has no attribute with the given name.
const ISInfoDocument &
getDescription(size_t pos);
-
Returns meta-information for the IS information type represented by this object. May throw daq::is::DocumentNotFound exception if the meta-information repository is not available or does not contain description of the given object type.
bool
isAttributeArray(size_t pos) const;
-
Returns true if the attribute at the given stream position is an array, otherwise returns false.
bool
isAttributeArray(size_t pos) const;
-
Returns true if the attribute with the given name is an array, otherwise returns false. May throw daq::is::AttributeNotFound if this object has no attribute with the given name.
std::ostream & operator<< ( std::ostream & out, ISInfoDynAny & da );
-
Print out value of the da to the standard output stream out.
2 July 1998 - WebMaster | Copyright © CERN 1998 |