CERN -> IPT Group -> FrameMaker at CERN
Information Service User's Guide

15.9 ISInfoDocument::Attribute


Synopsis
#include <is/infodocument.h>
const ISInfoDocument::Attribute * attr = isinfodoc.attribute( i );


Description

This class can be used to get the meta-information for the attributes of an IS information type. This meta-information includes attribute name, type and optional text describing this attribute.This class doesn't have public constructors. User can get a pointer to the instance of this class via the attribute method of the ISInfoDocument class.


Example
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()
11: << ( attr -> isArray() ? "[] " : " " )
12: << attr -> name() << "; // "
13: << attr -> description() << std::endl;
14: }
15: std::cout << "};" << std::endl;


Public Member Functions
const std::string &
description ( ) const

Returns attribute's text description. This might be an empty string if description has not been provided.

IntegerFormat
format ( ) const

Returns the format modifier, as defined in the corresponding XML file, which can be used to change the integer number representation in the text output. The IntegerFormat type is declared as standard stream manipulator:

typedef std::ios_base& (*IntegerFormat)(std::ios_base&)

This function can return the following values: std::oct, std::dec, std::hex.

bool
isArray ( ) const

Returns true if attribute is an array, otherwise returns false.

const std::string &
name ( ) const
Returns attribute's name.
const std::string &
range ( ) const
Returns range of the possible attributes value. Range is described by a string in a format which is specified by the OKS schema editor.
ISType::Basic
typeCode ( ) const
Returns id of the attribute's type.
const std::string &
typeName ( ) const
Returns attribute's type name.


2 July 1998 - WebMaster
Copyright © CERN 1998