ATLAS Offline Software
Loading...
Searching...
No Matches
SignalStateHelper.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7// SignalStateHelper.cxx
9
10// EventKernel includes
12
13//*****************************************************************
14//
15// SignalStateHelper
16//
17//*****************************************************************
18
19
26
35
43
47 m_object(theObject)
48{
49 if( theObject != NULL ){
50 m_originalState = theObject->signalState();
51 m_object->setSignalState(m_currentState);
52 }
53}
54
59
62{
64 m_originalState = theObject->signalState();
65 m_object = theObject;
67 m_object->setSignalState(m_currentState);
68 return true;
69}
70
72{
74 // If we do have an object attached, switch its signal state
76 {
77 m_object->setSignalState(m_currentState);
78 return true;
79 }
80 return false;
81}
82
84{
85 // If we have an object attached, revert and remove
86 if(m_object!=0)
87 {
88 m_object->setSignalState(m_originalState);
89 m_object=0;
90 return true;
91 }
92 return false;
93}
94
96{
97 if(m_object!=0)
98 {
100 m_object->setSignalState(m_originalState);
101 return true;
102 }
103 return false;
104}
105
106//*****************************************************************
107//
108// SignalStateConstHelper
109//
110//*****************************************************************
111
112
119
128
136
140 m_object(const_cast<ISignalState*>(theObject))
141{
142 if( theObject != NULL ){
143 m_originalState = theObject->signalState();
144 m_object->setSignalState(m_currentState);
145 }
146}
147
152
155{
157 m_originalState = theObject->signalState();
158 m_object = const_cast<ISignalState*>(theObject);
160 m_object->setSignalState(m_currentState);
161 return true;
162}
163
165{
166 m_currentState = s;
167 // If we do have an object attached, switch its signal state
169 {
170 m_object->setSignalState(m_currentState);
171 return true;
172 }
173 return false;
174}
175
177{
178 // If we have an object attached, revert and remove
179 if(m_object!=0)
180 {
181 m_object->setSignalState(m_originalState);
182 m_object=0;
183 return true;
184 }
185 return false;
186}
187
189{
190 if(m_object!=0)
191 {
193 m_object->setSignalState(m_originalState);
194 return true;
195 }
196 return false;
197}
198
ISignalState is an abstract base class providing support for various Signal States to be associated w...
virtual P4SignalState::State signalState() const =0
obtain the current signal state
bool releaseObject()
Release controled object (this resets its signal state)
ISignalState * m_object
Pointer to the owned object.
bool setSignalState(P4SignalState::State s)
Change the signal state for future operations.
P4SignalState::State m_originalState
Storage of the states.
SignalStateConstHelper()
Empty Constructor.
P4SignalState::State m_currentState
bool controlObject(const ISignalState *theObject)
Change the object controlled, this releases previous object and resets its SigState.
bool resetSignalState()
Reset the Signal State of the controlled object and use it for future operations.
bool resetSignalState()
Reset the Signal State of the controlled object and use it for future operations.
~SignalStateHelper()
Destructor.
bool releaseObject()
Release controled object (this resets its signal state)
SignalStateHelper()
Empty Constructor.
ISignalState * m_object
Pointer to the owned object.
P4SignalState::State m_originalState
Storage of the states.
bool setSignalState(P4SignalState::State s)
Change the signal state for future operations.
bool controlObject(ISignalState *theObject)
Change the object controlled, this releases previous object and resets its SigState.
P4SignalState::State m_currentState