cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsWatchdogClient.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 Author(s): Marcin Balicki
6 Created on: 2014
7 
8 (C) Copyright 2014 Johns Hopkins University (JHU), All Rights Reserved.
9 
10 --- begin cisst license - do not edit ---
11 
12 This software is provided "as is" under an open source license, with
13 no warranty. The complete license can be found in license.txt and
14 http://www.cisst.org/cisst/license.txt.
15 
16 --- end cisst license ---
17 */
18 
19 #ifndef _mtsWatchdogClient_h
20 #define _mtsWatchdogClient_h
21 
27 
29  // used to control the log level, "Run Error" by default
30  CMN_DECLARE_SERVICES(CMN_NO_DYNAMIC_CREATION, CMN_LOG_LOD_RUN_ERROR);
31 protected:
33  double Timeout;
34  struct {
38  } Watchdog;
39 
40  bool IsOK;
41 public:
43  Timeout(0),
44  IsOK(false)
45  {};
46 
48 
50 
51  void SetTimeoutPeriod(const double & seconds) {
52  Timeout = seconds;
53  }
54 
55  bool Start(void);
56 
57  // true if everything is ok;
58  bool CheckAndUpdate(void);
59  bool Reset(void);
60 };
61 
63 
64 #endif // _mtsWatchdogClient_h
Defines the command interfaces.
Defines a function object to use a void command (mtsCommandVoid)
Defines the command interfaces.
Definition: mtsFunctionRead.h:37
bool Reset(void)
CMN_DECLARE_SERVICES_INSTANTIATION(mtsWatchdogClient)
void AddToRequiredInterface(mtsInterfaceRequired &reqInt)
bool Start(void)
Definition: mtsInterfaceRequired.h:85
#define CMN_LOG_LOD_RUN_ERROR
Definition: cmnLogLoD.h:93
Definition: mtsFunctionVoid.h:36
Base class for high level objects.
Definition: cmnGenericObject.h:51
bool IsOK
Definition: mtsWatchdogClient.h:40
bool CheckAndUpdate(void)
struct mtsWatchdogClient::@130 Watchdog
mtsFunctionVoid ResetState
Definition: mtsWatchdogClient.h:37
double Timeout
Definition: mtsWatchdogClient.h:33
void SetTimeoutPeriod(const double &seconds)
Definition: mtsWatchdogClient.h:51
Definition: osaStopwatch.h:82
Definition: mtsWatchdogClient.h:28
Defines cmnGenericObject.
mtsFunctionWrite WriteState
Definition: mtsWatchdogClient.h:36
Definition: mtsFunctionWrite.h:37
~mtsWatchdogClient()
Definition: mtsWatchdogClient.h:47
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
mtsWatchdogClient()
Definition: mtsWatchdogClient.h:42
osaStopwatch StopWatch
Definition: mtsWatchdogClient.h:32
mtsFunctionRead ReadState
Definition: mtsWatchdogClient.h:35