CMS 3D CMS Logo

ActivityRegistry Class Reference

#include <FWCore/ServiceRegistry/interface/ActivityRegistry.h>

Detailed Description

Description: Registry holding the signals that Services can subscribe to

Usage: Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application.

There are unit tests for the signals that use the Tracer to print out the transitions as they occur and then compare to a reference file. One test does this for a SubProcess test and the other for a test using unscheduled execution. The tests are in FWCore/Integration/test: run_SubProcess.sh testSubProcess_cfg.py run_TestGetBy.sh testGetBy1_cfg.py testGetBy2_cfg.py

There are four little details you should remember when adding new signals to this file that go beyond the obvious cut and paste type of edits.

  1. The number at the end of the AR_WATCH_USING_METHOD_X macro definition is the number of function arguments. It will not compile if you use the wrong number there.
  2. Use connect or connect_front depending on whether the callback function should be called for different services in the order the Services were constructed or in reverse order. Begin signals are usually forward and End signals in reverse, but if the service does not depend on other services and vice versa this does not matter.
  3. The signal needs to be added to either connectGlobals or connectLocals in the ActivityRegistry.cc file, depending on whether a signal is seen by children or parents when there are SubProcesses. For example, source signals are only generated in the top level process and should be seen by all child SubProcesses so they are in connectGlobals. Most signals however belong in connectLocals. It does not really matter in jobs without at least one SubProcess.
  4. Each signal also needs to be added in copySlotsFrom in ActivityRegistry.cc. Whether it uses copySlotsToFrom or copySlotsToFromReverse depends on the same ordering issue as the connect or connect_front choice in item 2 above.