Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataOnDemandSvc.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_DATAONDEMANDSVC_H
2 #define GAUDISVC_DATAONDEMANDSVC_H
3 // ============================================================================
4 // Include Files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <map>
9 #include <vector>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
13 #include "GaudiKernel/Service.h"
14 #include "GaudiKernel/SvcFactory.h"
17 #include "GaudiKernel/StatEntity.h"
18 #include "GaudiKernel/StringKey.h"
21 // ============================================================================
22 // Reflex
23 // ============================================================================
24 #include "Reflex/Reflex.h"
25 // ============================================================================
26 // Forward declarations
27 // ============================================================================
28 class IAlgTool;
29 class IAlgorithm;
30 class IAlgManager;
31 class IIncidentSvc;
32 class IDataProviderSvc;
33 class IToolSvc;
34 // ============================================================================
91 class DataOnDemandSvc: public extends1<Service, IIncidentListener>
92 {
93 public:
94  // ==========================================================================
95  // Typedefs
98  // ==========================================================================
103  struct Protection
104  {
105  bool& m_bool;
106  Protection(bool& b) : m_bool(b) { m_bool = true; }
107  ~Protection() { m_bool = false; }
108  };
109  // ==========================================================================
115  struct Node
116  {
117  // ========================================================================
119  ClassH clazz ; // the actual class
120  bool executing ;
122  unsigned long num ;
124  bool dataObject ; // trivial object? DataObject?
125  // =======================================================================
127  : clazz ( )
128  , executing ( false )
129  , name ( )
130  , num ( 0 )
131  , dataObject ( false )
132  {}
133  // ========================================================================
135  bool e ,
136  const std::string& n )
137  : clazz ( c )
138  , executing ( e )
139  , name ( n )
140  , num ( 0 )
141  , dataObject ( "DataObject" == n )
142  {}
143  //
144  Node( const Node& c )
145  : clazz ( c.clazz )
146  , executing ( c.executing )
147  , name ( c.name )
148  , num ( c.num )
149  , dataObject ( c.dataObject )
150  {}
151  // ========================================================================
152  };
153  // ==========================================================================
155  struct Leaf
156  {
158  bool executing ;
161  unsigned long num ;
162  Leaf() : algorithm ( 0 ) , executing (false ) , name() , type() , num ( 0 ) {}
163  Leaf(const Leaf& l)
164  : algorithm(l.algorithm),
165  executing(l.executing), name(l.name), type(l.type), num(l.num) {}
166  Leaf(const std::string& t, const std::string& n)
167  : algorithm(0), executing(false), name(n), type(t), num(0) {}
168  };
169  // ==========================================================================
170 public:
171  // ==========================================================================
175  virtual StatusCode initialize();
177  virtual StatusCode finalize();
179  virtual StatusCode reinitialize();
181  virtual void handle(const Incident& incident);
188  ( const std::string& name , // Service instance name
189  ISvcLocator* svc ) ; // Pointer to service locator
191  virtual ~DataOnDemandSvc(); // Standard destructor
192  // ==========================================================================
193 protected:
194  // ==========================================================================
200  // ==========================================================================
206  StatusCode execHandler(const std::string& tag, Leaf& leaf);
207  // ==========================================================================
213  StatusCode execHandler(const std::string& tag, Node& node);
214  // ==========================================================================
217  // ==========================================================================
220  // ==========================================================================
222  StatusCode setup();
224  void i_setNodeHandler(const std::string &name, const std::string &type);
226  StatusCode i_setAlgHandler(const std::string &name, const Gaudi::Utils::TypeNameString &alg);
227  // ==========================================================================
228 public:
229  // ==========================================================================
230  void update_1 ( Property& p ) ;
231  void update_2 ( Property& p ) ;
232  void update_3 ( Property& p ) ;
234  void update_dump ( Property& /* p */ ) ;// update handler for 'Dump' property
235  // ==========================================================================
236 protected:
237  // ==========================================================================
239  StatusCode update() ;
241  inline MsgStream& stream () const
242  {
243  if ( 0 == m_log ) { m_log = new MsgStream( msgSvc() , name() ) ; }
244  return *m_log;
245  }
250  void dump ( const MSG::Level level , const bool mode = true ) const ;
251  // ==========================================================================
252 private:
253  // ==========================================================================
269  bool m_dump ;
271  bool m_init ;
283  //
286  Map m_algMap ; // { 'data' : 'algorithm' }
288  Map m_nodeMap ; // { 'data' : 'type' }
291  mutable MsgStream* m_log ;
292  // ==========================================================================
297  // ==========================================================================
304  // ==========================================================================
309 };
310 // ============================================================================
311 
312 // ============================================================================
313 // The END
314 // ============================================================================
315 #endif // GAUDISVC_DATAONDEMANDSVC_H
316 // ============================================================================
317 

Generated at Wed Dec 4 2013 14:33:08 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004