PLCnext API Documentation  22.9.0.33
Bit.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 namespace Arp { namespace Plc { namespace Commons { namespace Gds
9 {
10 
14 class Bit
15 {
16 public: // typedefs
17 
18 public: // construction/destruction
20  Bit(bool value = false);
21 
22 public: // operators
23  operator bool(void)const;
24 
25 public: // setter/getter operations
26  bool IsSet(void)const;
27 
28 private: // fields
29  bool value;
30 };
31 
33 // inline operations of class Bit
34 
36 inline Bit::Bit(bool value):
37  value(value)
38 {
39 }
40 
42 inline Bit::operator bool()const
43 {
44  return this->IsSet();
45 }
46 
48 inline 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