LRAUV  revA
ReadDataComponent.h
Go to the documentation of this file.
1 
12 #ifndef READDATACOMPONENT_H_
13 #define READDATACOMPONENT_H_
14 
15 #include "component/Behavior.h"
16 #include "data/DataAccessor.h"
17 #include "data/StrValue.h"
18 
19 class MissionItem;
20 class MissionNode;
21 class Module;
22 class ValueClause;
23 
40 {
41 public:
42 
43  static ReadDataComponent* Instance( MissionNode* node, const Str& itemName,
44  MissionItem* parent, const Module* module, Logger& logger );
45 
46  ReadDataComponent( const Str& prefix );
47 
48  virtual ~ReadDataComponent();
49 
51  void initialize( void );
52 
54  void initializeReaders( void );
55 
57  void run();
58 
60  bool isSatisfied();
61 
63  bool runIfUnsatisfied();
64 
66  void preempted();
67 
69  void uninitialize( void );
70 
72  static Behavior* CreateBehavior( const Str& prefix, const Module* module );
73 
74 protected:
75 
76  // Specific sensors which are read
78 
79  // Names of Variables that are read - converted to readers by initializeReaders
81 
82  // Variables that are read - not using readers_ because of readers below
84 
85  // Reads in the value to test the interval against - null if time used
87 
88  // Last value the interval was tested against.
90 
91  // Reads in the interval
93 
95 
97 
99 
100  static const StrValue NO_VALUE;
101 
102  void requestData( bool requestingData );
103 
104 private:
105  // Note that the copy constructor below is private and not given a body.
106  // Any attempt to call it will return a compiler error.
107  ReadDataComponent( const ReadDataComponent& old ); // disallow copy constructor
108 
109 };
110 
111 #endif /*READDATACOMPONENT_H_*/
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
FlexArray< Str * > readerNames_
Definition: ReadDataComponent.h:80
Wraps a Behavior or Aggregate with mission-specific settings pertaining to that item.
Definition: MissionItem.h:31
static const StrValue NO_VALUE
Definition: ReadDataComponent.h:100
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: DataReader.h:30
bool initializedReaders_
Definition: ReadDataComponent.h:96
ValueClause * intervalSettingClause_
Definition: ReadDataComponent.h:92
void uninitialize(void)
Uninit function.
Definition: ReadDataComponent.cpp:322
double lastIntervalValue_
Definition: ReadDataComponent.h:89
void run()
Just do the run: ignore the results of the satisfied.
Definition: ReadDataComponent.cpp:197
DataReader * intervalValueReader_
Definition: ReadDataComponent.h:86
Behavior is the abstract base class for components that implement mission behaviors and commands...
Definition: Behavior.h:32
void preempted()
Called when the mission component becomes preempted.
Definition: ReadDataComponent.cpp:312
Contains the ReadDataComponent Behavior/Command.
Definition: ReadDataComponent.h:39
static ReadDataComponent * Instance(MissionNode *node, const Str &itemName, MissionItem *parent, const Module *module, Logger &logger)
Definition: ReadDataComponent.cpp:22
A ValueClause is a set of boolean conditions that may be specified as conditions for executing (or st...
Definition: ValueClause.h:26
bool runIfUnsatisfied()
Do the run, and return true if envelope "satisfied".
Definition: ReadDataComponent.cpp:232
Contains the StrValue class definition.
Contains the Behavior class definition.
FlexArray< Component * > sensors_
Definition: ReadDataComponent.h:77
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
virtual ~ReadDataComponent()
Definition: ReadDataComponent.cpp:146
Wraps a TiXmlNode.
Definition: MissionNode.h:20
Replacement for standard template class string.
Definition: Str.h:12
bool isSatisfied()
Just do the satisfied: return true if envelope "satisfied".
Definition: ReadDataComponent.cpp:204
bool intervalTriggered_
Definition: ReadDataComponent.h:94
Contains the DataAccessor class definition.
static Behavior * CreateBehavior(const Str &prefix, const Module *module)
Mission Component factory interface.
ReadDataComponent(const Str &prefix)
Definition: ReadDataComponent.cpp:131
FlexArray< DataReader * > varReaders_
Definition: ReadDataComponent.h:83
DataAccessor::RequestStrategy requestStrategy_
Definition: ReadDataComponent.h:98
void initializeReaders(void)
Initialize function for DataReaders.
Definition: ReadDataComponent.cpp:162
Wraps a string (see Str) as a DataValue, so strings can be written to and read from the slate...
Definition: StrValue.h:34
void requestData(bool requestingData)
Definition: ReadDataComponent.cpp:244
void initialize(void)
Initialize function.
Definition: ReadDataComponent.cpp:155
RequestStrategy
Definition: DataAccessor.h:41