LRAUV  revA
Maintainer.h
Go to the documentation of this file.
1 
11 #ifndef MAINTAINER_H_
12 #define MAINTAINER_H_
13 
15 #include "data/DataValue.h"
16 #include "utils/FlexArray.h"
17 
18 template<typename T> class FlexArray;
19 
35 {
36 
37 public:
38 
40  Maintainer();
41 
42  void addMaintain( unsigned short int uriCode, DataValue* dataValue,
43  SyncComponent::CycleOrder cycleOrder, bool unavailable, bool invalid );
44  void removeMaintain( unsigned short int uriCode );
45  void removeAllMaintains();
46  void listMaintains();
47 
48 private:
49 
50  // Note that the copy constructor below is private and not given a body.
51  // Any attempt to call it will return a compiler error.
52  Maintainer( const Maintainer& old ); // disallow copy constructor
53 
56  {
57  public:
59  MaintainItem( unsigned short int uriCode, DataValue* dataValue,
60  SyncComponent::CycleOrder cycleOrder, bool unavailable, bool invalid );
61 
62  virtual void run()
63  {
64  maintain();
65  }
66 
67  Str makeName( unsigned short int uriCode );
68  unsigned short int getUriCode();
70 
71  void setDataValue( DataValue* dataValue );
72  bool maintain();
73  void maintainStatus();
74 
75  void setUnavailable( bool unavailable )
76  {
77  unavailable_ = unavailable;
78  }
79 
80  void setInvalid( bool invalid )
81  {
82  invalid_ = invalid;
83  }
84 
86  ~MaintainItem();
87 
88  private:
89 
90  // Note that the copy constructor below is private and not given a body.
91  // Any attempt to call it will return a compiler error.
92  MaintainItem( const MaintainItem& old ); // disallow copy constructor
93 
94  bool initDataWriter();
95 
96  unsigned short int uriCode_;
102  bool invalid_;
103  };
104 
107 };
108 
109 #endif /* MAINTAINER_H_ */
Mutex mutex_
Definition: Maintainer.h:106
DataValue * dataValue_
Definition: Maintainer.h:98
Contains the SyncComponent class definition.
void addMaintain(unsigned short int uriCode, DataValue *dataValue, SyncComponent::CycleOrder cycleOrder, bool unavailable, bool invalid)
Definition: Maintainer.cpp:23
bool invalid_
Definition: Maintainer.h:102
void setInvalid(bool invalid)
Definition: Maintainer.h:80
~MaintainItem()
Destructor.
Definition: Maintainer.cpp:224
void setDataValue(DataValue *dataValue)
Definition: Maintainer.cpp:145
bool unavailable_
Definition: Maintainer.h:101
A simple pthread Mutex abstraction.
Definition: Mutex.h:20
A DataValue is an abstract base class for a data value and associated engineering units of the value...
Definition: DataValue.h:35
Maintainer()
Constructor for Maintainer.
Definition: Maintainer.cpp:18
DataValue * getDataValue()
Definition: Maintainer.cpp:139
void removeMaintain(unsigned short int uriCode)
Definition: Maintainer.cpp:54
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
Contains the FlexArrayBase and FlexArray class declarations.
void listMaintains()
Definition: Maintainer.cpp:94
MaintainItem(unsigned short int uriCode, DataValue *dataValue, SyncComponent::CycleOrder cycleOrder, bool unavailable, bool invalid)
Constructor.
Definition: Maintainer.cpp:110
void maintainStatus()
Definition: Maintainer.cpp:172
void setUnavailable(bool unavailable)
Definition: Maintainer.h:75
bool initDataWriter()
Definition: Maintainer.cpp:203
unsigned short int getUriCode()
Definition: Maintainer.cpp:133
These are enumerated to simplify sorting and ordering.
Definition: SyncComponent.h:42
virtual void run()
The actual "payload" of the component.
Definition: Maintainer.h:62
Component responsible for handling periodic logging of variable values to the syslog and the console...
Definition: Maintainer.h:34
Replacement for standard template class string.
Definition: Str.h:12
Abstract Base class for software components.
Definition: Component.h:53
void removeAllMaintains()
Definition: Maintainer.cpp:88
Keeps track of which how we have to maintain each DataElement.
Definition: Maintainer.h:55
bool maintain()
Definition: Maintainer.cpp:155
FlexArray< MaintainItem * > maintainArray_
Definition: Maintainer.h:105
Abstract Base class for components that run before the servos allowing command-line overrides of guid...
Definition: SyncComponent.h:240
DataWriter * dataWriter_
Definition: Maintainer.h:100
DataElement * dataElement_
Definition: Maintainer.h:97
Contains the DataValue class definition.
Simple class providing a flexible size array of pointers.
Definition: DataReader.h:19
unsigned short int uriCode_
Definition: Maintainer.h:96
Str makeName(unsigned short int uriCode)
Definition: Maintainer.cpp:122
Component * owner_
Definition: Maintainer.h:99
Abstact base class for one "element" of the Slate.
Definition: DataElement.h:37