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

12.12 ISInfoProvider


Synopsis
#include <is/infoprovider.h>
ISInfoProvider::instance().addCommandListener( &lst );


Description

This class implements a singleton, which is used to activate and deactivate user specific command listeners. This class has no public constructors. The instance of this class can be retrieved via the static ISInfoProvider::instance() function.


Example
1: class MyCommandListener : public ISCommandListener
2: {
3: public:
4: void command( const std::string & name, const std::string & cmd )
5: {
6: std::cout << "MyCommandListener:: command '" << cmd
7: << "' received for the '" << name << "' info" << std::endl;
8: }
9: };
10:
11: MyCommandListener lst;
12:
13: ISInfoProvider::instance().addCommandListener( &lst );


Public Member Functions
void 
addCommandListener ( ISCommandListener * lst );
Activate the lst listener. Activation means that this listener will receive the commands, which have been sent to the information objects, created by the current process (i.e. process, which this listener belongs to).
void 
removeCommandListener ( ISCommandListener * lst );
Deactivate the lst listener. Deactivation means that this listener will not receive the commands anymore.


Public Static Function
ISInfoProvider & 
instance ( );
Returns the reference to the ISInfoProvider's instance. There is always single instance of this class per any process.


2 July 1998 - WebMaster
Copyright © CERN 1998