| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# IToolSvc::Observer Class Reference

`#include <IToolSvc.h>`

List of all members.

## Detailed Description

allow call-backs when a tool is a created or retrieved

       class myObserver : public ITooSvc::Observer {
            void onCreate(IAlgTool& tool) {
                cout << "tool " << tool.name() << " created " << endl;
            }
            void onRetrieve(IAlgTool& tool) {
                cout << "someone requested " << tool.name() <<endl;
            }

       }

       myObserver *observer = new myObserver;
       IToolSvc* svc = ...
       svc->registerObserver(observer);

IToolSvc implementations will call 'ObserveronCreate' when a tool is created, and 'ObserveronRetrieve' if a tool is retrieved.

The user is responsible of the life time of the object and must un-register it before it is deleted (e.g. during the finalization).

Definition at line 236 of file IToolSvc.h.

## Public Member Functions
virtual | ~Observer ()
virtual void | onCreate (const IAlgTool *)
virtual void | onRetrieve (const IAlgTool *)

## Constructor & Destructor Documentation

virtual IToolSvc::Observer::~Observer | ( |  | ) | `[inline, virtual]`

Definition at line 238 of file IToolSvc.h.

    00238 {}

## Member Function Documentation

virtual void IToolSvc::Observer::onCreate | ( | const IAlgTool * |  | ) | `[inline, virtual]`

Definition at line 239 of file IToolSvc.h.

Referenced by ToolSvc::create().

    00239 {}

virtual void IToolSvc::Observer::onRetrieve | ( | const IAlgTool * |  | ) | `[inline, virtual]`

Definition at line 240 of file IToolSvc.h.

Referenced by ToolSvc::retrieve().

    00240 {}

The documentation for this class was generated from the following file:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiKernel/v25r2/GaudiKernel/IToolSvc.h