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

8.3 Sending commands to information providers

Listing 8.2 shows how an application can send commands to an information provider.

In order to do send command to a particular information provider it is necessary to read one of the information objects, which were published by this provider, from the IS repository (line 21). As soon as this is done successfully one can use the ISInfo::sendCommand method to send a command to the provider of that information (lines 24-25).

 

Listing 8.2   Sending commands example

1: // include main IS header file
2: #include <is/infodocument.h>
3: #include <ipc/core.h>
4:
5: int main( int ac, char ** av ) {
6: // Initialise communication library
7: IPCCore::init( ac, av );
8:
9: // Create the instance of partition
10: IPCPartition partition("MyPartition");
11:
12: // Create the IS discitonary
13: ISInfoDictionary(partitition);
14:
15: // Create the instance of the information
16: // to which we want to send command
17: ISInfoInt voltage;
18:
19: // Read information from the IS
20: ISInfo::Status status;
21: status = dict.getValue( "MyServer.DeviceVoltage", voltage );
22:
23: // Only if we read the info successfully we can send command
24: if ( status == ISInfo::Success )
25: voltage.sendCommand( "republish" );
26:
27: return 0;
28: }


2 July 1998 - WebMaster
Copyright © CERN 1998