12.12 ISInfoProvider
#include <is/infoprovider.h>
ISInfoProvider::instance().addCommandListener( &lst );
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.
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 );
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.
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 |