BAOS SDK  18.2.0
Public Member Functions | List of all members
kdrive::baos::ScopedBaosHeartbeat Class Reference

Auto starts and stops the Heartbeat class using RAII. More...

#include <BaosHeartbeat.h>

Inheritance diagram for kdrive::baos::ScopedBaosHeartbeat:
kdrive::baos::BaosHeartbeat

Public Member Functions

 ScopedBaosHeartbeat (std::shared_ptr< BaosConnector > connector, unsigned int interval=1000)
 Creates a ScopedBaosHeartbeat and auto-starts the heartbeat thread. More...
 
virtual ~ScopedBaosHeartbeat ()
 Destroys the scoped boas heartbeat. More...
 
- Public Member Functions inherited from kdrive::baos::BaosHeartbeat
 BaosHeartbeat (std::shared_ptr< BaosConnector > connector, unsigned int interval=1000)
 Creates a BaosHeartbeat and associates it with a connection precondition: connector is not null. More...
 
virtual ~BaosHeartbeat ()
 Destroys the BaosHeartbeat Stops the heartbeat thread if it is still active. More...
 
void start ()
 Starts the heartbeat thread. More...
 
void stop ()
 Stops the heartbeat thread. More...
 
bool isAlive () const
 Returns true if the last request was successful. More...
 
unsigned long getTimeSinceReset () const
 Returns the last successful value of the server item time since reset. More...
 
void setAutoTerminate (bool autoTerminate, int failCount=3)
 If autoTerminate is true we disconnect the connection and raise the terminated event as soon as isAlive is false. More...
 

Detailed Description

Auto starts and stops the Heartbeat class using RAII.

Deprecated:
This class exists only for backward compatibility.
See also
BaosHeartbeat

Constructor & Destructor Documentation

ScopedBaosHeartbeat::ScopedBaosHeartbeat ( std::shared_ptr< BaosConnector connector,
unsigned int  interval = 1000 
)

Creates a ScopedBaosHeartbeat and auto-starts the heartbeat thread.

precondition: connector is not null

ScopedBaosHeartbeat::~ScopedBaosHeartbeat ( )
virtual

Destroys the scoped boas heartbeat.

Stops the heartbeat thread.


The documentation for this class was generated from the following files: