The Gaudi Framework  v30r3 (a5ef0a68)
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:44
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
230  std::ostringstream oss;
231  oss << m_slot.algsStates[props.m_algoIndex];
232  return oss.str();
233  }
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:49
std::string precedence::EntityState::operator() ( const DecisionHubProps ) const
inline

Definition at line 235 of file PrecedenceRulesGraph.h.

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

Definition at line 237 of file PrecedenceRulesGraph.h.

238  {
240 
242  if ( m_whiteboard->selectStore( m_slot.eventContext->slot() ).isSuccess() )
243  state = m_whiteboard->exists( props.m_id ) ? "Produced" : "Missing";
244 
245  return state;
246  }
ContextID_t slot() const
Definition: EventContext.h:40
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:44
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 248 of file PrecedenceRulesGraph.h.

249  {
251 
252  if ( m_condSvc.isValid() && m_slot.eventContext->valid() )
253  state = m_condSvc->isValidID( *( m_slot.eventContext ), props.m_id ) ? "Produced" : "Missing";
254 
255  return state;
256  }
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:44
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 262 of file PrecedenceRulesGraph.h.

SmartIF<ICondSvc> precedence::EntityState::m_condSvc

Definition at line 261 of file PrecedenceRulesGraph.h.

EventSlot precedence::EntityState::m_slot

Definition at line 258 of file PrecedenceRulesGraph.h.

SmartIF<IHiveWhiteBoard> precedence::EntityState::m_whiteboard

Definition at line 260 of file PrecedenceRulesGraph.h.


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