Emergency 20 Dokumentation  4.2.0
ActivitySystem-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Includes ]
6 //[-------------------------------------------------------]
8 
9 
10 //[-------------------------------------------------------]
11 //[ Namespace ]
12 //[-------------------------------------------------------]
13 namespace em5
14 {
15 
16 
17  //[-------------------------------------------------------]
18  //[ Public methods ]
19  //[-------------------------------------------------------]
21  {
22  Activity* activity = mActivityManager.findElement(assetProxy.getLocalAssetId());
23  if (nullptr == activity)
24  {
25  activity = loadActivityByAsset(assetProxy);
26  }
27  return activity;
28  }
29 
31  {
32  // It's safe in here to cast the pointer to a reference because we know that the pointer is never ever a null pointer
33  QSF_ASSERT(nullptr != mActivityStepFactory, "The activity step factory instance is invalid", QSF_REACT_THROW);
34  return *mActivityStepFactory;
35  }
36 
37 
38  //[-------------------------------------------------------]
39  //[ Public virtual qsf::System methods ]
40  //[-------------------------------------------------------]
41  inline const char* ActivitySystem::getName() const
42  {
43  return "Activity system";
44  }
45 
46 
47 //[-------------------------------------------------------]
48 //[ Namespace ]
49 //[-------------------------------------------------------]
50 } // em5
LocalAssetId getLocalAssetId() const
Return the local ID of the asset this asset proxy wraps up.
Definition: ActionPriority.h:13
#define QSF_REACT_THROW
Definition: ErrorHandling.h:203
Activity step factory.
Definition: ActivityStepFactory.h:42
Activity * getActivityByAsset(const qsf::AssetProxy &assetProxy)
Definition: ActivitySystem-inl.h:20
ActivityStepFactory & getActivityStepFactory() const
Definition: ActivitySystem-inl.h:30
Asset proxy class.
Definition: AssetProxy.h:57
Activity class.
Definition: Activity.h:39
ELEMENT * findElement(const KEY &key) const
Find a specific element by its key in either the element map.
Definition: ElementManager-inl.h:39
#define QSF_ASSERT(condition, explanation, reaction)
Definition: ErrorHandling.h:138
virtual const char * getName() const override
Get the name of the system.
Definition: ActivitySystem-inl.h:41