CARMA C++
AlarmControlROH.h
1 #ifndef CARMA_FAULT_ALARMCONTROLROH_H
2 #define CARMA_FAULT_ALARMCONTROLROH_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include <carma/corba/corba.h>
8 #include <carma/alarm/AlarmControl.h>
9 
10 
11 namespace carma {
12 namespace fault {
13 
14 
15 class AlarmControlROH {
16  public:
17  explicit AlarmControlROH( );
18 
19  virtual ~AlarmControlROH( );
20 
21  bool setState(const bool alarmOn,
22  const std::string &sound,
23  const std::string &mpName);
24  private:
25  // No copying
26  AlarmControlROH( const AlarmControlROH & rhs );
27  AlarmControlROH & operator=( const AlarmControlROH & rhs );
28 
29  void setObjRefStateToResolved( );
30  void setObjRefStateToDisconnected( );
31  void setObjRefStateToConnected( );
32 
33  bool resolveObjRef( );
34 
35  bool isObjReachable( bool alarmSubsysCurrent );
36 
37  alarm::AlarmControl_var remoteObj( );
38 
39  void flushPrevCallsLogging( bool forceTransition );
40 
41  void logGoodCall( const ::std::string & callString,
42  double callMjd,
43  size_t maxConsecPerLog );
44 
45  void processCaught( const ::std::string & callString );
46 
47  typedef enum {
48  OBJ_REF_STATE_NEVER_SET,
49  OBJ_REF_STATE_RESOLVED,
50  OBJ_REF_STATE_DISCONNECTED,
51  OBJ_REF_STATE_CONNECTED
52  } ObjRefState;
53 
54  const ::std::string doName_;
55  ObjRefState objRefState_;
56  alarm::AlarmControl_var objRef_;
57  bool haveGoodPrevCalls_;
58  ::std::string prevCallsCallString_;
59  ::std::vector< double > prevCallsUnloggedMjdVec_;
60 };
61 
62 
63 } // namespace carma::fault
64 } // namespace carma
65 
66 #endif