-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatusCondition.h
More file actions
89 lines (73 loc) · 3.03 KB
/
Copy pathStatusCondition.h
File metadata and controls
89 lines (73 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* StatusCondition.h
*
* Created on: 29. juni 2012
* Author: KVik
*/
#ifndef DCPS_StatusCondition_h_IsIncluded
#define DCPS_StatusCondition_h_IsIncluded
#include"DCPS/IncludeExtLibs.h"
#include"DCPS/Status/State.h"
#include"DCPS/Export.h"
namespace DCPS { namespace Infrastructure {
class Entity;
}}
namespace DCPS { namespace Status
{
/**
* @brief
*
* A StatusCondition object is a specific Condition that is associated with each Entity.
*
* The trigger_value of the StatusCondition depends on the communication status of that entity (e.g., arrival of
* data, loss of information, etc.), filtered by the set of enabled_statuses on the StatusCondition.
* The enabled_statuses and its relation to Listener and WaitSet is detailed in Trigger State of the StatusCondition.
*/
class DLL_STATE StatusCondition : public BaseLib::Concurrent::GuardCondition
{
public:
StatusCondition(DCPS::Infrastructure::Entity *entity, const Status::StatusMask &mask = Status::StatusMask::All());
StatusCondition(const StatusCondition &condition);
virtual ~StatusCondition();
public:
/**
* @brief
*
* This operation defines the list of communication statuses that are taken into account to determine the
* trigger_value of the StatusCondition. This operation may change the trigger_value of the StatusCondition.
* WaitSet objects behavior depend on the changes of the trigger_value of their attached conditions.
* Therefore, any WaitSet to which the StatusCondition is attached is potentially affected by this operation.
* If this function is not invoked, the default list of enabled statuses includes all the statuses.
*/
ReturnCode::Type SetEnabledStatuses(const Status::StatusMask &mask);
/**
* @brief
*
* This operation retrieves the list of communication statuses that are taken into account to determine the
* trigger_value of the StatusCondition. This operation returns the statuses that were explicitly set on the
* last call to set_enabled_statuses or, if set_enabled_statuses was never called, the default list
* (see Section 7.1.2.1.9.1).
*/
Status::StatusMask GetEnabledStatuses() const;
/**
* @brief
*
* This operation returns the Entity associated with the StatusCondition. Note that there is exactly one
* Entity associated with each StatusCondition.
*/
DCPS::Infrastructure::Entity* GetEntity() const;
/**
* @brief
*
* The trigger_value of a StatusCondition is the Boolean OR of the ChangedStatusFlag of all the communication statuses
* to which it is sensitive. That is, trigger_value==FALSE only if all the values of the ChangedStatusFlags are FALSE.
* The sensitivity of the StatusCondition to a particular communication status is controlled by the list of enabled_statuses
* set on the condition by means of the set_enabled_statuses operation.
*/
virtual void SetTriggerValue(bool triggerValue);
private:
DCPS::Infrastructure::Entity *entity_;
Status::StatusMask statusMask_;
};
}}
#endif