-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypeConsistencyEnforcement.h
66 lines (52 loc) · 1.45 KB
/
TypeConsistencyEnforcement.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
64
65
/*
* TypeConsistencyEnforcement.h
*
* Created on: Sep 9, 2012
* Author: knuthelv
*/
#ifndef DDS_Policy_TypeConsistencyEnforcement_h_Included
#define DDS_Policy_TypeConsistencyEnforcement_h_Included
#include"DDS/CommonDefines.h"
#include"DDS/Policy/QosPolicyBase.h"
#include"DDS/Policy/PolicyKind.h"
#include"DDS/Export.h"
namespace DDS { namespace Policy
{
/**
* @brief The TypeConsistencyEnforcement class
*/
class DLL_STATE TypeConsistencyEnforcement : public QosPolicyBase
{
public:
TypeConsistencyEnforcement()
: kind_(Policy::TypeConsistencyEnforcementKind::EXACT_TYPE_TYPE_CONSISTENCY)
{}
TypeConsistencyEnforcement(Policy::TypeConsistencyEnforcementKind::Type kind)
: kind_(kind)
{}
virtual ~TypeConsistencyEnforcement()
{}
DEFINE_POLICY_TRAITS(TypeConsistencyEnforcement, 24, DDS::Policy::RequestedOfferedKind::NOT_APPLICABLE, true)
public:
virtual void Write(NetworkLib::SerializeWriter *writer) const
{
writer->WriteInt8((const char)kind_);
}
virtual void Read(NetworkLib::SerializeReader *reader)
{
kind_ = (Policy::TypeConsistencyEnforcementKind::Type) reader->ReadInt8();
}
public:
void SetKind(Policy::TypeConsistencyEnforcementKind::Type kind)
{
kind_ = kind;
}
Policy::TypeConsistencyEnforcementKind::Type GetKind() const
{
return kind_;
}
private:
Policy::TypeConsistencyEnforcementKind::Type kind_;
};
}}
#endif