15.8 ISInfoDocument
#include <is/infodocument.h>
#include <Person.h>
IPCPartition p ( "MyPartition" );
Person person;
ISInfoDocument isid( p, person );
This class can be used to get the meta-information for the IS information type. This meta-information includes the information type name, type description and also names, types and descriptions for all the attributes of this type.
1: #include <Person.h>
2:
3: IPCPartition p ( "MyPartition" );
4: Person person;
5: ISInfoDocument isd( p, person );
6: std::cout << "class " << isd.name() << " { // " << isd.description() << std::endl;
7: for ( unsigned int i = 0; i < isd.attributeCount(); i++ )
8: {
9: const ISInfoDocument::Attribute * attr = isd.attribute( i );
10: std::cout << "" << attr -> typeName() << ( attr -> isArray() ? "[] " : " " ) << attr -> name() << "; // " << attr -> description() << std::endl;
11: }
12: std::cout << "};" << std::endl;
ISInfoDocument( const IPCPartition & p, ISInfo & info );
-
Constructs new ISInfoDocument object which can be used to get description of the info information object in the p partition.
-
Throws daq::is::DocumentNotFound if either the IS Meta-information repository was not set up properly or the it does not contain description of the given IS information type. These two cases can be recognized by checking the nested exception.
ISInfoDocument( const IPCPartition & part, const ISType & type );
-
Constructs new ISInfoDocument object which can be used to get description of the type information type in the p partition.
-
Throws daq::is::DocumentNotFound if either the IS Meta-information repository was not set up properly or the it does not contain description of the given IS information type. These two cases can be recognized by checking the nested exception.
size_t
attributeCount ( ) const
-
Returns number of attributes for this information type.
const Attribute *
attribute ( size_t N ) const
-
Returns pointer to the object which contains description for the Nth attribute of this information type.
const Attribute *
attribute ( const std::string & name ) const
-
Returns pointer to the object which contains description for the name attribute of this information type.
-
Throws daq::is::AttributeNotFound is the type object does not contain attribute with the given name.
size_t attributePosition( const std::string & name ) const
Returns position of the name attribute in the given information type. The first attribute has position 0. Position's index is defined by the order in which the attributes are declared in the corresponding XML file.
Throws daq::is::AttributeNotFound is the type object does not contain attribute with the given name.
const std::string &
description ( ) const
-
Returns text description for this information type.
const std::string &
name ( ) const
-
Returns name of this information type.
2 July 1998 - WebMaster | Copyright © CERN 1998 |