-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLatencyBudget.h
63 lines (53 loc) · 1.63 KB
/
LatencyBudget.h
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
/*
* LatencyBudget.h
*
* Created on: Sep 5, 2012
* Author: knuthelv
*/
#ifndef DDS_Policy_LatencyBudget_h_Included
#define DDS_Policy_LatencyBudget_h_Included
#include"DDS/CommonDefines.h"
#include"DDS/Policy/PolicyKind.h"
#include"DDS/Policy/QosPolicyBase.h"
#include"DDS/Export.h"
namespace DDS { namespace Policy
{
/**
* @abstract
*
* This policy provides a means for the application to indicate to the middleware the "urgency" of the data-communication.
* By having a non-zero duration the Service can optimize its internal operation.
*
* This policy is considered a hint. There is no specified mechanism as to how the service should take advantage of this hint.
*
* The value offered is considered compatible with the value requested if and only if the inequality "offered duration <=
* requested duration" evaluates to "TRUE".
*/
class DLL_STATE LatencyBudget : public QosPolicyBase
{
public:
LatencyBudget(const BaseLib::Duration& d)
: duration_(d)
{ }
LatencyBudget()
: duration_(BaseLib::Duration::Zero())
{ }
DEFINE_POLICY_TRAITS(LatencyBudget, 5, DDS::Policy::RequestedOfferedKind::COMPATIBLE, true)
public:
virtual void Write(NetworkLib::SerializeWriter *) const
{
// TODO: Write Duration
}
virtual void Read(NetworkLib::SerializeReader *)
{
// TODO: Read Duration
}
public:
void SetDuration(const BaseLib::Duration& d) { duration_ = d; }
const BaseLib::Duration GetDuration() const { return duration_; }
BaseLib::Duration& GetDuration() { return duration_; }
private:
BaseLib::Duration duration_;
};
}} // DDS::Policy
#endif // DDS_Policy_LatencyBudget_h_Included