The Gaudi Framework  v30r0 (c919700c)
precedence::EntityState Struct Reference

#include <src/PrecedenceRulesGraph.h>

Inheritance diagram for precedence::EntityState:
Collaboration diagram for precedence::EntityState:

Public Member Functions

 EntityState (const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator, bool conditionsEnabled)
 
std::string operator() (const AlgoProps &props) const
 
std::string operator() (const DecisionHubProps &) const
 
std::string operator() (const DataProps &props) const
 
std::string operator() (const CondDataProps &props) const
 

Public Attributes

EventSlot m_slot
 
SmartIF< IHiveWhiteBoardm_whiteboard
 
SmartIF< ICondSvcm_condSvc
 
bool m_conditionsEnabled {false}
 

Detailed Description

Definition at line 201 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

precedence::EntityState::EntityState ( const EventSlot slot,
SmartIF< ISvcLocator > &  svcLocator,
bool  conditionsEnabled 
)
inline

Definition at line 202 of file PrecedenceRulesGraph.h.

203  : m_slot( slot ), m_conditionsEnabled( conditionsEnabled )
204  {
205  SmartIF<IMessageSvc> msgSvc{svcLocator};
206  MsgStream log{msgSvc, "EntityState.Getter"};
207 
208  // Figure if we can discover the data object states
209  m_whiteboard = svcLocator->service<IHiveWhiteBoard>( "EventDataSvc", false );
210  if ( !m_whiteboard.isValid() ) {
211  log << MSG::WARNING << "Failed to locate EventDataSvc: no way to add DO "
212  << "states to the TTT dump " << endmsg;
213  }
214 
215  if ( m_conditionsEnabled ) {
216  // Figure if we can discover Condition data object states
217  m_condSvc = svcLocator->service<ICondSvc>( "CondSvc", false );
218  if ( !m_condSvc.isValid() )
219  log << MSG::WARNING << "Failed to locate CondSvc: no way to add Condition DO "
220  << "states to the TTT dump " << endmsg;
221  }
222 
223  if ( !m_slot.eventContext->valid() )
224  log << MSG::WARNING << "Event context is invalid: no way to add DO states"
225  << " in the TTT dump" << endmsg;
226  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:28
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
SmartIF< ICondSvc > m_condSvc
Interface for the Condition Service.
Definition: ICondSvc.h:28
SmartIF< IHiveWhiteBoard > m_whiteboard
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:68
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
bool valid() const
Definition: EventContext.h:41

Member Function Documentation

std::string precedence::EntityState::operator() ( const AlgoProps props) const
inline

Definition at line 228 of file PrecedenceRulesGraph.h.

229  { // Returns algorithm's FSM state
231  State state = m_slot.algsStates[props.m_algoIndex];
232  switch ( state ) {
233  case State::INITIAL:
234  return "INITIAL";
235  case State::CONTROLREADY:
236  return "CONTROLREADY";
237  case State::DATAREADY:
238  return "DATAREADY";
239  case State::SCHEDULED:
240  return "SCHEDULED";
241  case State::EVTACCEPTED:
242  return "EVTACCEPTED";
243  case State::EVTREJECTED:
244  return "EVTREJECTED";
245  case State::ERROR:
246  return "ERROR";
247  default:
248  return "UNKNOWN";
249  }
250  }
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:33
State
Execution states of the algorithms.
std::string precedence::EntityState::operator() ( const DecisionHubProps ) const
inline

Definition at line 252 of file PrecedenceRulesGraph.h.

252 { return ""; }
std::string precedence::EntityState::operator() ( const DataProps props) const
inline

Definition at line 254 of file PrecedenceRulesGraph.h.

255  {
257 
259  if ( m_whiteboard->selectStore( m_slot.eventContext->slot() ).isSuccess() )
260  state = m_whiteboard->exists( props.m_id.fullKey() ) ? "Produced" : "Missing";
261 
262  return state;
263  }
ContextID_t slot() const
Definition: EventContext.h:40
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:28
virtual bool exists(const DataObjID &)=0
Check if a data object exists in store.
STL class.
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given &#39;slot&#39; for all subsequent calls within the same thread id.
SmartIF< IHiveWhiteBoard > m_whiteboard
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:68
bool valid() const
Definition: EventContext.h:41
std::string precedence::EntityState::operator() ( const CondDataProps props) const
inline

Definition at line 265 of file PrecedenceRulesGraph.h.

266  {
268 
269  if ( m_condSvc.isValid() && m_slot.eventContext->valid() )
270  state = m_condSvc->isValidID( *( m_slot.eventContext ), props.m_id.fullKey() ) ? "Produced" : "Missing";
271 
272  return state;
273  }
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:28
STL class.
SmartIF< ICondSvc > m_condSvc
virtual bool isValidID(const EventContext &ctx, const DataObjID &id) const =0
check to see if a specific condition object ID is valid for this event
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:68
bool valid() const
Definition: EventContext.h:41

Member Data Documentation

bool precedence::EntityState::m_conditionsEnabled {false}

Definition at line 279 of file PrecedenceRulesGraph.h.

SmartIF<ICondSvc> precedence::EntityState::m_condSvc

Definition at line 278 of file PrecedenceRulesGraph.h.

EventSlot precedence::EntityState::m_slot

Definition at line 275 of file PrecedenceRulesGraph.h.

SmartIF<IHiveWhiteBoard> precedence::EntityState::m_whiteboard

Definition at line 277 of file PrecedenceRulesGraph.h.


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