45 #ifndef G4TRACKSTATE_HH_
46 #define G4TRACKSTATE_HH_
86 virtual int GetID() = 0;
93 template <
typename T>
168 fMultipleTrackStates[adress] = state;
173 std::map<void*, G4VTrackStateHandle>::const_iterator it =
174 fMultipleTrackStates.find(adress);
175 if (it == fMultipleTrackStates.end())
185 std::map<void*, G4VTrackStateHandle>::const_iterator it =
186 fMultipleTrackStates.find((
void*) adress);
187 if (it == fMultipleTrackStates.end())
195 fTrackStates[state->GetID()] = state;
200 std::map<int, G4VTrackStateHandle>::const_iterator it = fTrackStates.find(
202 if (it == fTrackStates.end())
226 #define G4TrackStateHandle(T) G4shared_ptr<G4TrackState<T> >
228 template<
class OriginalType>
236 template<
class FinalType>
316 #if __cplusplus > 199711L
317 #define RegisterTrackState(CLASS,STATE) \
319 class G4TrackState<CLASS> : public G4TrackStateBase<CLASS>, \
320 public CLASS::STATE \
322 friend class G4TrackStateDependent<CLASS>; \
323 using CLASS::STATE::STATE; \
325 typedef CLASS::STATE State; \
326 G4TrackState() : G4TrackStateBase<CLASS>(), CLASS::STATE(){}\
327 virtual ~G4TrackState(){}\
330 return G4TrackStateID<CLASS>::GetID();\
334 return G4TrackStateID<CLASS>::GetID();\
339 #define RegisterTrackState(CLASS,STATE) \
341 class G4TrackState<CLASS> : public G4TrackStateBase<CLASS>, \
342 public CLASS::STATE \
344 friend class G4TrackStateDependent<CLASS>; \
346 typedef CLASS::STATE State; \
347 G4TrackState() : G4TrackStateBase<CLASS>(), CLASS::STATE(){}\
348 virtual ~G4TrackState(){}\
351 return G4TrackStateID<CLASS>::GetID();\
355 return G4TrackStateID<CLASS>::GetID();\
G4VTrackStateHandle GetTrackState() const
virtual StateTypeHandle GetConcreteTrackState() const
G4VTrackStateHandle GetTrackState(void *adress) const
void SetTrackState(G4VTrackStateHandle state)
virtual G4VTrackStateHandle GetTrackState() const
StateTypeHandle fpTrackState
virtual void LoadTrackState(G4TrackStateManager &manager)
virtual void SetTrackState(G4shared_ptr< StateType > state)
virtual void NewTrackState()=0
void SetTrackState(void *adress, G4VTrackStateHandle state)
G4shared_ptr< G4VTrackState > G4VTrackStateHandle
virtual void ResetTrackState()=0
virtual ~G4TrackStateBase()
virtual void ResetTrackState()
virtual void NewTrackState()
std::map< int, G4VTrackStateHandle > fTrackStates
virtual G4VTrackStateHandle GetTrackState() const =0
virtual void LoadTrackState(G4TrackStateManager &)=0
virtual ~G4VTrackStateDependent()
G4VTrackStateHandle GetTrackState(T *adress) const
virtual ~G4TrackStateDependent()
#define G4dynamic_pointer_cast
virtual ~G4VTrackStateID()
std::map< void *, G4VTrackStateHandle > fMultipleTrackStates
G4shared_ptr< StateType > StateTypeHandle
virtual G4VTrackStateHandle PopTrackState()
G4shared_ptr< G4VTrackState > ConvertToAbstractTrackState(G4shared_ptr< G4TrackState< OriginalType > > state)
G4TrackState< T > StateType
virtual void SaveTrackState(G4TrackStateManager &manager)
virtual void SaveTrackState(G4TrackStateManager &)=0
virtual StateTypeHandle CreateTrackState() const
virtual G4VTrackStateHandle PopTrackState()=0
G4shared_ptr< G4TrackState< FinalType > > ConvertToConcreteTrackState(G4VTrackStateHandle state)