Emergency 20 Dokumentation  4.2.0
DummyEmergencyLighting.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
40  static const uint32 COMPONENT_ID;
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public methods ]
46  //[-------------------------------------------------------]
47  public:
55  explicit DummyEmergencyLighting(qsf::Prototype* prototype);
56 
57  bool getEmergencyLightingOn() const;
58  void setEmergencyLightingOn(bool value);
59 
60 
61  //[-------------------------------------------------------]
62  //[ Private data ]
63  //[-------------------------------------------------------]
64  private:
65  bool mEmergencyLightingOn;
66 
67 
68  //[-------------------------------------------------------]
69  //[ CAMP reflection system ]
70  //[-------------------------------------------------------]
71  QSF_CAMP_RTTI();
72 
73 
74  };
75 
76 
77  // TODO(co) No inline implementation inside headers, please (we need to be able to keep an overview)
79  Component(prototype),
80  mEmergencyLightingOn(false)
81  {}
82 
84  {
85  return mEmergencyLightingOn;
86  }
87 
89  {
90  assignAndPromoteChange(mEmergencyLightingOn, value, EMERCENGY_LIGHT_PROPERTY_ID);
91  }
92 
93 
94 //[-------------------------------------------------------]
95 //[ Namespace ]
96 //[-------------------------------------------------------]
97 } //em5
98 
99 
100 //[-------------------------------------------------------]
101 //[ CAMP reflection system ]
102 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
DummyEmergencyLighting(qsf::Prototype *prototype)
Constructor.
Definition: DummyEmergencyLighting.h:78
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
void setEmergencyLightingOn(bool value)
Definition: DummyEmergencyLighting.h:88
EMERGENCY 5 dummy emergency lighting class: Signals to AI whether a vehicle has emergency lighting on...
Definition: DummyEmergencyLighting.h:32
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
static const uint32 EMERCENGY_LIGHT_PROPERTY_ID
Unique CAMP ID of the boolean activation property.
Definition: DummyEmergencyLighting.h:41
QSF_CAMP_TYPE(em5::DummyEmergencyLighting)
Prototype class.
Definition: Prototype.h:100
bool getEmergencyLightingOn() const
Definition: DummyEmergencyLighting.h:83
static const uint32 COMPONENT_ID
"em5::DummyEmergencyLighting" unique component ID
Definition: DummyEmergencyLighting.h:40
bool assignAndPromoteChange(T &variable, const S &newValue, uint32 propertyId)
Comfort function for updating an exported member variable and promoting any change that happened...
Definition: Component-inl.h:141