45 #ifndef G4TRACKSTATE_HH_
46 #define G4TRACKSTATE_HH_
107 virtual int GetID() = 0;
121 template <
typename T>
222 fMultipleTrackStates[adress] = state;
227 std::map<void*, G4VTrackStateHandle>::const_iterator it =
228 fMultipleTrackStates.find(adress);
229 if (it == fMultipleTrackStates.end())
239 std::map<void*, G4VTrackStateHandle>::const_iterator it =
240 fMultipleTrackStates.find((
void*) adress);
241 if (it == fMultipleTrackStates.end())
249 fTrackStates[state->GetID()] = state;
254 std::map<int, G4VTrackStateHandle>::const_iterator it = fTrackStates.find(
256 if (it == fTrackStates.end())
284 #define G4TrackStateHandle(T) G4shared_ptr<G4TrackState<T> >
286 template<
class OriginalType>
290 G4shared_ptr<G4VTrackState> output = CLHEP::dynamic_pointer_cast<
G4VTrackState>(state);
294 template<
class FinalType>
374 #define RegisterTrackState(CLASS,STATE) \
376 class G4TrackState<CLASS> : public G4TrackStateBase<CLASS>, public STATE \
378 typedef STATE State; \
379 friend class G4TrackStateDependent<CLASS>; \
381 G4TrackState() : G4TrackStateBase<CLASS>(),STATE(){}\
382 virtual ~G4TrackState(){}\
385 return G4TrackStateID<CLASS>::GetID();\
389 return G4TrackStateID<CLASS>::GetID();\
G4VTrackStateHandle GetTrackState() const
virtual StateTypeHandle GetConcreteTrackState() const
G4VTrackStateHandle GetTrackState(void *adress) const
void SetTrackState(G4VTrackStateHandle state)
type_wrapper< T > traits_type
virtual G4VTrackStateHandle GetTrackState() const
StateTypeHandle fpTrackState
virtual void LoadTrackState(G4TrackStateManager &manager)
virtual int GetStateID()=0
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()
virtual ~G4VTrackStateID()
std::map< void *, G4VTrackStateHandle > fMultipleTrackStates
type_wrapper< T > traits_type
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 void SetTrackState(CLHEP::shared_ptr< StateType > state)
virtual G4VTrackStateHandle PopTrackState()=0
G4shared_ptr< G4TrackState< FinalType > > ConvertToConcreteTrackState(G4VTrackStateHandle state)