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

4.3 Reading Object types from IS repository

One can also read the information type for any object published in the IS repository. It is possible to get a type of a particular object by using the ISInfoDictionary::getType function Listing 4.3.

Listing 4.3   Reading object type from IS repository

1: // include header file generated for the Person class
2: #include <Person.h>
3: #include <is/infodictionary.h>
4: #include <ipc/core.h>
5:
6: int main( int ac, char ** av )
7: {
8: // Initialise communication library
9: IPCCore::init( ac, av );
10:
11: // Create the instance of partition
12: IPCPartition partition(partition_name);
13:
14: // Create the IS dictionary instance
15: // using the partitition object as parameter
16: ISInfoDictionary dict(partitition);
17:
18: ISType type;
19: // Publish information
20: dict.getType( "MyServer.Person1", type );
21:
22: if ( Person::type() == type ) {
23: std::cout << "object MyServer.Person1 has type Person" << std::endl;
24: }
25: }

Alternatively one can use the ISInfoIterator::type function to get the type of the object at the current position of the iterator (Browsing the IS repository).


2 July 1998 - WebMaster
Copyright © CERN 1998