HDLC-Daemon
AliveGuard.h
Go to the documentation of this file.
1 
24 #ifndef ALIVE_GUARD_H
25 #define ALIVE_GUARD_H
26 
32 class AliveGuard {
33 public:
38  AliveGuard(): m_bAlive(true) {
39  }
40 
48  bool UpdateSerialPortState(bool a_bAlive) {
49  bool l_bStateChanged = (m_bAlive != a_bAlive);
50  m_bAlive = a_bAlive;
51  return l_bStateChanged;
52  }
53 
60  bool IsAlive() const { return m_bAlive; }
61 
62 private:
63  // Members
64  bool m_bAlive;
65 };
66 
67 #endif // ALIVE_GUARD_H
Class AliveGuard.
Definition: AliveGuard.h:32
bool UpdateSerialPortState(bool a_bAlive)
Change the serial port state.
Definition: AliveGuard.h:48
bool IsAlive() const
Query whether the related serial port is currently alive.
Definition: AliveGuard.h:60
AliveGuard()
The constructor of AccessGuard objects.
Definition: AliveGuard.h:38