Emergency 20 Dokumentation  4.2.0
HydrantComponent-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Namespace ]
6 //[-------------------------------------------------------]
7 namespace em5
8 {
9 
10 
11  //[-------------------------------------------------------]
12  //[ Public methods ]
13  //[-------------------------------------------------------]
15  qsf::Component(prototype),
16  mHydrantType(FIXED_HYDRANT)
17  {
18  // Nothing to do in here
19  }
20 
22  {
23  // Nothing to do in here
24  }
25 
27  {
28  return mHydrantType;
29  }
30 
32  {
33  mHydrantType = hydrantType;
34  }
35 
36  inline bool HydrantComponent::isReserved() const
37  {
38  return mInternalFlags.isSet(RESERVE_HYDRANT);
39  }
40 
41  inline void HydrantComponent::setReserved(bool reserved)
42  {
43  mInternalFlags.set(RESERVE_HYDRANT, reserved);
44  }
45 
46  inline bool HydrantComponent::isConnected() const
47  {
48  return mConnectedFireman.valid();
49  }
50 
52  {
53  return mConnectedFireman.get();
54  }
55 
56 
57 //[-------------------------------------------------------]
58 //[ Namespace ]
59 //[-------------------------------------------------------]
60 } // em5
Definition: ActionPriority.h:13
void set(ENUM flag)
Set a single flag.
Definition: EnumBitmask.h:187
Entity class.
Definition: Entity.h:46
HydrantType
Definition: HydrantComponent.h:45
HydrantType getHydrantType() const
Definition: HydrantComponent-inl.h:26
bool isConnected() const
Check if a fireman is currently connected to the hydrant.
Definition: HydrantComponent-inl.h:46
virtual ~HydrantComponent()
Destructor.
Definition: HydrantComponent-inl.h:21
Definition: PickupPersonByParamedicAction.h:21
bool isReserved() const
Return the state of the reservation from the hydrant.
Definition: HydrantComponent-inl.h:36
qsf::Entity * getConnectedFireman() const
Get the fireman that is currently connected to the hydrant.
Definition: HydrantComponent-inl.h:51
T * get() const
Get the internal pointer.
Definition: WeakPtr-inl.h:132
bool valid() const
Check if this instance contains is a valid pointer.
Definition: WeakPtr-inl.h:20
void setHydrantType(HydrantType hydrantType)
Definition: HydrantComponent-inl.h:31
void setReserved(bool reserved)
Set the state of the reservation from the hydrant.
Definition: HydrantComponent-inl.h:41
Prototype class.
Definition: Prototype.h:100
bool isSet(ENUM flag) const
Check whether a certain flag is set.
Definition: EnumBitmask.h:118
HydrantComponent(qsf::Prototype *prototype)
Constructor.
Definition: HydrantComponent-inl.h:14