PLCnext API Documentation 23.6.0.37
Bit.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8namespace Arp { namespace Plc { namespace Commons { namespace Gds
9{
10
14class Bit
15{
16public: // typedefs
17
18public: // construction/destruction
20 Bit(bool value = false);
21
22public: // operators
23 operator bool(void)const;
24
25public: // setter/getter operations
26 bool IsSet(void)const;
27
28private: // fields
29 bool value;
30};
31
33// inline operations of class Bit
34
36inline Bit::Bit(bool value):
37 value(value)
38{
39}
40
42inline Bit::operator bool()const
43{
44 return this->IsSet();
45}
46
48inline bool Bit::IsSet()const
49{
50 return value;
51}
52
53}}}} // end of namespace Arp::Plc::Commons::Gds
54
This class represents a single bit data type.
Definition: Bit.hpp:15
bool IsSet(void) const
Returns the state of a Bit object.
Definition: Bit.hpp:48
Bit(bool value=false)
Constructs an Bit instance.
Definition: Bit.hpp:36
Root namespace for the PLCnext API