|
LRAUV
revA
|
Collections of Behaviors (including other Aggregates) that make up a larger Behavior within a mission. More...
#include <Aggregate.h>


Public Member Functions | |
| virtual | ~Aggregate () |
| Destructor. More... | |
| virtual void | initialize () |
| Standard component init code. More... | |
| void | preempted () |
| Called when the mission component becomes preempted. More... | |
| virtual void | uninitialize () |
| Standard component uninit code. More... | |
| virtual void | execute () |
| Causes a run with no metrics. More... | |
| bool | containsPreemptive () |
| Returns true if the aggregate contains an active preemptive clause. More... | |
| void | logStack (int &priority) |
| Display the currently running stack to Syslog. More... | |
| virtual void | run () |
| The actual "payload" of the component. More... | |
| void | setIndex (const int index) |
| Sets the index within parent aggregate. More... | |
| MissionItem * | getItemByRefId (const Str &refId) |
| void | setRef (MissionItem *ref) |
| MissionItem * | getRef () |
| void | defineArg (const Str &argName, DataValue *dataValue, bool output) |
| void | redefineArg (const Str &argName, ValueClause *valueClause) |
| void | setParallel (bool parallel) |
| MissionItem * | getChild (const Str &childName) |
| void | setResumeItem (MissionItem *resumeItem) |
Public Member Functions inherited from Behavior | |
| virtual | ~Behavior () |
| bool | executeIfUnsatisfied () |
| Combined run and test with metrics generation. More... | |
| virtual bool | runIfUnsatisfied () |
| Combined run and test Called by mission element: behaviorDone_. More... | |
| virtual bool | isSatisfied () |
| virtual bool | isRunnable () |
| virtual bool | isSatisfiable () |
| virtual bool | isCommand () |
| BehaviorState | getBehaviorState () const |
| void | setBehaviorState (BehaviorState behaviorState) |
| virtual bool | isCompleted (void) |
| Query if this component is completed. More... | |
| SettingReader * | findSettingReader (const Str &settingURI) |
| SettingReader * | addValueClause (const Str &uriPart, ValueClause *valueClause) |
| void | addArgWriter (const Str &uriPart, DataWriter *argWriter) |
| const Timespan & | getTimeout () |
| void | setTimeout (const Timespan &timeout) |
Public Member Functions inherited from Component | |
| virtual | ~Component () |
| Destructor cleans up readers_ and writers_. More... | |
| void | registerReader (DataReader *reader) |
| void | unregisterReader (DataReader *reader) |
| void | registerWriter (DataWriter *writer) |
| void | unregisterWriter (DataWriter *writer) |
| void | disableMetering (void) |
| FlexArray< DataReader * > & | getReaderList (void) |
| FlexArray< DataWriter * > & | getWriterList (void) |
| const Module * | getModule () |
| virtual void | configure () |
| Read (or re-read!) configuration settings. More... | |
| bool | isActive () const |
| Indicates if the component is active. More... | |
| const CodedStr & | getName (void) const |
| Returns the name. More... | |
| const Timestamp & | getTimeOfLastRun (void) const |
| ComponentState | getState (void) |
| Return the component's current state. More... | |
| void | setState (ComponentState state) |
| RunState | getRunState (void) |
| Return the component's run state. More... | |
| bool | isUsingRunState () |
| Return true if using runState. More... | |
| void | requestData (bool requestingData) |
| Tell the component to start (or stop) sending data. More... | |
| void | requestStart () |
| Tell the component to start runnning. More... | |
| void | requestPause (const Timespan expectedPauseTime) |
| Tell the component to pause runnning. More... | |
| void | requestResume () |
| Tell the component resume from pause. More... | |
| void | requestStop () |
| Tell the component to stop runnning. More... | |
| virtual RunState | start () |
| Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence. More... | |
| virtual RunState | starting () |
| Might follow a STOP...START sequence Subseqent. More... | |
| virtual RunState | runnable () |
| Should eventually follow a START request or RESETTING. More... | |
| virtual RunState | satisfied () |
| Possible return value of a Behavior. More... | |
| virtual RunState | pause () |
| Pause for a short period (indicated by pauseTime) More... | |
| virtual RunState | pausing () |
| Might follow a PAUSE request. More... | |
| virtual RunState | paused () |
| Should eventually follow a PAUSE request: should set continueTime. More... | |
| virtual RunState | resume () |
| Resume from PAUSE. More... | |
| virtual RunState | resuming () |
| Might follow a PAUSE...RESUME sequence. More... | |
| virtual RunState | resetting () |
| Might occur in case of Error. More... | |
| virtual RunState | stop () |
| Initial state – can be later followed by START. More... | |
| virtual RunState | stopping () |
| Might follow a STOP request. More... | |
| virtual RunState | stopped () |
| Should eventually follow a STOP request. More... | |
| void | setCriticalFailureReported (bool boolVal) |
| void | setRecoveringFromCritical (bool boolVal) |
| void | setFailureReported (bool boolVal) |
| bool | isFailureUninitialized () |
| void | setFailureUninitialized (bool boolVal) |
| void | setRetryTimeout (const Timespan &timeout) |
| void | setPeriod (const Timespan &period) |
| Set the period of this component... used if it is periodic. More... | |
| const Timespan & | getPeriod (void) |
| Returns the component's period (regardless of whether it is periodic) More... | |
| ComponentType | getComponentType () |
| Getter function for ComponentType. More... | |
| virtual bool | isFailed (void) const |
| virtual FailureMode::FailType | getFailureType (void) const |
| virtual bool | getCriticalFailureReported (void) const |
| virtual bool | getFailureReported (void) const |
| virtual Timespan | getRetryTimeout (void) const |
| virtual FailureMode::FailType | setFailure (FailureMode::FailType failureType) |
| virtual int | getFailCount (void) const |
| virtual bool | isFailureMissionCritical () |
| virtual int | getAllowableFailures (void) const |
| virtual void | setAllowableFailures (int fails) |
| Logger & | getLogger (void) |
| virtual int | incrementFailCount (void) |
| virtual void | resetFailCount (void) |
| virtual int | getSkippedRunsSinceFail (void) const |
| virtual int | incrementSkippedRunsSinceFail (void) |
| virtual void | logVoltage (float voltage, float averageVoltage) |
| virtual void | logCurrent (float current, float averageCurrent) |
| const Timestamp & | getWriteTimestamp (void) |
| void | setWriteTimestamp (const Timestamp &writeTimestamp) |
| BlobReader * | newBlobReader (const BlobURI &blobURI) |
| BlobReader * | newBlobReaderFromUniversal (const Str &componentName, const UniversalBlobURI &blobURI) |
| BlobWriter * | newBlobWriter (const BlobURI &blobURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| ConfigReader * | newConfigReader (const ConfigURI &configURI) |
| DataReader * | newDataReader (const DataURI &dataURI) |
| DataReader * | newDataReaderFromUniversal (const Str &componentName, const UniversalURI &universalURI) |
| DataWriter * | newDataWriter (const DataURI &dataURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalBlobReader * | newUniversalBlobReader (const UniversalBlobURI &universalURI) |
| UniversalBlobWriter * | newUniversalBlobWriter (const UniversalBlobURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalDataReader * | newUniversalReader (const UniversalURI &universalURI) |
| UniversalDataWriter * | newUniversalWriter (const UniversalURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
Static Public Member Functions | |
| static Aggregate * | Instance (const Str &name, MissionNode *node, Logger &logger) |
| Converts table/function at the indicated node to a Aggregate instance. More... | |
Protected Member Functions | |
| void | gotoNextItem () |
| Update activeItem_ with the next behavior in the aggregate. More... | |
| DataReader * | findArgReader (const Str &argName) |
| Returns the reader for a defined arg. More... | |
Protected Member Functions inherited from Behavior | |
| Behavior (const Str &name, const Module *module, const bool runnable, const bool satisfiable) | |
| Protected constructor for abstract base class. More... | |
| Behavior (const Behavior &old) | |
| SettingReader * | newSettingReader (const Str &uriPart, const DataValue *defaultValue, bool deleteDefaultValue=true) |
| SettingReader * | newSettingReader (const SettingURI &uriPart) |
| DataWriter * | findArgWriter (const OutputURI &uriPart) |
Protected Member Functions inherited from Component | |
| virtual ConfigURI | getConfigURI (ConfigOption configOption) const |
| Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc. More... | |
| virtual ConfigURI | getConfigURI (ConfigOption configOption, ElementURI forElement) const |
| Should return [myNamespace]::POWER_[forElement], [myNamespace]::LATENCY_[forElement], etc. More... | |
| virtual void | setDurationOfLastRun (const Timespan &span) |
| virtual void | setTimeOfRun (const Timestamp &time) |
| virtual void | setTimeOfLastRun (const Timestamp &time) |
| virtual void | setDt (const Timespan &dt) |
| virtual bool | setEnabled (bool enabled=true) |
| void | setRunState (const RunState runState) |
| const Timespan | getPauseTime () const |
| virtual void | setFailureMissionCritical (bool failureMissionCritical) |
| bool | simulateHardware () |
Protected Attributes | |
| FlexArray< MissionItem * > | behaviors_ |
| Behavior list. More... | |
| MissionItem * | ref_ |
| Alternate "reference" item. More... | |
| MissionItem * | activeItem_ |
| Currently active item. More... | |
| MissionItem * | resumeItem_ |
| Item to make active when mission is resumed. More... | |
| int | index_ |
| Index within parent aggregate. More... | |
| bool | parallel_ |
| Flag for parallel aggregates. More... | |
| int | nonParallelChildren_ |
| Number of children that are non-parallel. More... | |
| FastMap< const Str, DataReader * > * | argMap_ |
| List of defined args. More... | |
| FlexArray< Assign * > * | redefines_ |
| List of Assign elements used for redefining Args. More... | |
Protected Attributes inherited from Behavior | |
| bool | runnable_ |
| bool | satisfiable_ |
| BehaviorState | behaviorState_ |
| Timespan | timeout_ |
| Time before this behavior must end – defaults no timeout. More... | |
| FastMap< const Str, SettingReader * > * | settingReaderMap_ |
| FastMap< const Str, DataWriter * > * | argWriterMap_ |
Protected Attributes inherited from Component | |
| Logger | logger_ |
| Syslog::Severity | debugLevel_ |
| ComponentState | state_ |
| Keep track of whether the component has "completed" or should be run again. More... | |
| Timespan | desiredPeriod_ |
| CodedStr & | name_ |
| Store the component's name (used for logging purposes) More... | |
| Timestamp | timeOfRun_ |
| Timestamp | timeOfLastRun_ |
| Timespan | durationOfLastRun_ |
| Timespan | dt_ |
| Timespan | retryTimeout_ |
| bool | enabled_ |
| bool | failureReported_ |
| Indicates if the failure has been reported – cuts down on syslog. More... | |
| bool | criticalFailureReported_ |
| Indicates if a "Critical" failure has been reported – cuts down on syslog. More... | |
| bool | recoveringFromCritical_ |
| Indicates that a component had a previous critical failure that has been cleared temporarily awaiting final word from the component itself. More... | |
| bool | failureUninitialized_ |
| Indicates if the failure has resulted in an uninitialize call. More... | |
| int | failCount_ |
| Number of failures logged by PCaller. More... | |
| bool | failureMissionCritical_ |
| If true (default), complete failure ends mission. More... | |
| int | allowableFailures_ |
| Number of failures allowed to occur. More... | |
| int | skippedRunsSinceFail_ |
| Number of skipped runs since failureMode_ set by failCount_. More... | |
| FailureMode::FailType | failureType_ |
| Failed status. If failCount_ > 0, then this may be reset. More... | |
| Timestamp | timeOfFailure_ |
| Time of last failure. Relevant only if failed=true. More... | |
| Timestamp | writeTimestamp_ |
| Time of last write. More... | |
| FlexArray< DataReader * > | readers_ |
| FlexArray< DataWriter * > | writers_ |
| const Module * | module_ |
| Timespan | pauseTime_ |
| bool | meteringEnabled_ |
| If true, metering is enabled. More... | |
| DataWriter * | durationOfLastRunWriter_ |
| Writer for durationOfLastRun. More... | |
| DataWriter * | voltageWriter_ |
| DataWriter * | avgVoltageWriter_ |
| DataWriter * | currentWriter_ |
| DataWriter * | avgCurrentWriter_ |
| bool | persistentPause_ |
| True if data is persistent while component is paused. More... | |
Private Member Functions | |
| Aggregate (const Aggregate &old) | |
| Aggregate (const Str &name) | |
| Normal Private Constructor. More... | |
| void | push (MissionItem *item) |
| Adds a MissionItem to the aggregate. More... | |
Friends | |
| class | MissionItem |
Additional Inherited Members | |
Public Types inherited from Behavior | |
| enum | BehaviorState { BEHAVIOR_INACTIVE, BEHAVIOR_CALLED, BEHAVIOR_ACTIVE, BEHAVIOR_TIMEOUT, BEHAVIOR_COMPLETED } |
Public Types inherited from Component | |
| enum | ComponentState { BLOCK_CONTINUOUS, BLOCK_PERIODIC, BLOCK_NORMAL, BLOCK_COMPLETED, BLOCK_UNKNOWN } |
| In this model, the component has basically two states: wanting to run, and completed (no longer needing to run). More... | |
| enum | ComponentType { COMPONENT_ASYNC, COMPONENT_CONFIG, COMPONENT_BEHAVIOR, COMPONENT_SYNC } |
| Components can indicate how they want to be handled by their type. More... | |
| enum | RunState { NO_RUN_STATE = 0, START, STARTING, RUNNABLE, SATISFIED, PAUSE, PAUSING, PAUSED, RESUME, RESUMING, RESETTING, STOP, STOPPING, STOPPED } |
Protected Types inherited from Component | |
| enum | ConfigOption { CONFIG_SIMULATE_HARDWARE, CONFIG_POWER, CONFIG_FREQUENCY, CONFIG_LATENCY } |
Collections of Behaviors (including other Aggregates) that make up a larger Behavior within a mission.
|
virtual |
Destructor.
References argMap_, and redefines_.
|
private |
|
private |
Normal Private Constructor.
Private constructor.
References Behavior::BEHAVIOR_INACTIVE, and Behavior::setBehaviorState().
| bool Aggregate::containsPreemptive | ( | ) |
Returns true if the aggregate contains an active preemptive clause.
References activeItem_, behaviors_, MissionItem::isActive(), MissionItem::isPreemptive(), and FlexArrayBase::size().
Referenced by MissionItem::isPreemptive().
|
inlinevirtual |
|
protected |
Returns the reader for a defined arg.
References argMap_, and FastMap< S, T >::get().
Referenced by redefineArg().
| MissionItem * Aggregate::getChild | ( | const Str & | childName | ) |
References behaviors_, FlexArray< T >::get(), MissionItem::getComponent(), Component::getName(), and FlexArrayBase::size().
Referenced by MissionManager::resumeLoadedMission().
| MissionItem * Aggregate::getItemByRefId | ( | const Str & | refId | ) |
|
inline |
References ref_.
|
protected |
Update activeItem_ with the next behavior in the aggregate.
Advances activeItem_ to the next sequential behavior.
Sets activeItem_ to NULL if there are no more sequential behaviors.
References activeItem_, Behavior::BEHAVIOR_COMPLETED, Behavior::BEHAVIOR_TIMEOUT, behaviors_, Component::getName(), MissionItem::getTablePosition(), Timespan::INVALID_TIMESPAN, nonParallelChildren_, MissionStateLogger::SetActive(), Behavior::setBehaviorState(), FlexArrayBase::size(), and Behavior::timeout_.
Referenced by initialize(), and run().
|
virtual |
Standard component init code.
Reimplemented from Component.
References activeItem_, MissionItem::addCall(), Behavior::BEHAVIOR_ACTIVE, Behavior::BEHAVIOR_INACTIVE, behaviors_, Syslog::DEBUG, MissionItem::getComponent(), MissionItem::getWhenClause(), gotoNextItem(), MissionItem::initialize(), Timespan::INVALID_TIMESPAN, MissionItem::isInitialized(), MissionItem::isSequence(), Component::logger_, Component::name_, nonParallelChildren_, parallel_, ref_, resumeItem_, Behavior::setBehaviorState(), FlexArrayBase::size(), Logger::syslog(), and Behavior::timeout_.
|
static |
Converts table/function at the indicated node to a Aggregate instance.
| void Aggregate::logStack | ( | int & | priority | ) |
Display the currently running stack to Syslog.
References activeItem_, behaviors_, Component::getName(), Syslog::IMPORTANT, MissionItem::isActive(), MissionItem::isPreemptive(), Component::logger_, FlexArrayBase::size(), and Logger::syslog().
Referenced by MissionManager::logStack().
|
virtual |
Called when the mission component becomes preempted.
Reimplemented from Behavior.
References behaviors_, MissionItem::preempted(), and FlexArrayBase::size().
|
private |
Adds a MissionItem to the aggregate.
References behaviors_, and FlexArray< T >::push().
| void Aggregate::redefineArg | ( | const Str & | argName, |
| ValueClause * | valueClause | ||
| ) |
|
virtual |
The actual "payload" of the component.
Actual "payload" of the component.
Reimplemented from Component.
References activeItem_, Behavior::BEHAVIOR_ACTIVE, Behavior::BEHAVIOR_COMPLETED, behaviors_, Component::execute(), FlexArray< T >::get(), Behavior::getBehaviorState(), MissionItem::getComponent(), Component::getLogger(), Component::getName(), MissionItem::getRepeatIndex(), MissionItem::getRepeatLimit(), gotoNextItem(), Syslog::INFO, MissionItem::initialize(), MissionItem::isActive(), Behavior::isCompleted(), MissionItem::isInitialized(), MissionItem::isParallel(), MissionItem::isPreemptive(), MissionItem::isSequence(), Component::logger_, MissionItem::preempted(), redefines_, ref_, MissionItem::run(), MissionItem::runIfUnsatisfied(), MissionItem::satisfied(), Component::satisfied(), Behavior::setBehaviorState(), MissionItem::setRepeatIndex(), FlexArrayBase::size(), Logger::syslog(), and MissionItem::uninitialize().
Referenced by execute().
|
inline |
Sets the index within parent aggregate.
References index_.
|
inline |
References parallel_.
|
inline |
References ref_.
|
inline |
References resumeItem_.
Referenced by MissionManager::resumeLoadedMission().
|
virtual |
Standard component uninit code.
Reimplemented from Component.
References Behavior::BEHAVIOR_INACTIVE, behaviors_, Syslog::DEBUG, Component::logger_, Component::name_, ref_, MissionItem::removeCall(), Behavior::setBehaviorState(), FlexArrayBase::size(), and Logger::syslog().
|
friend |
|
protected |
Currently active item.
Referenced by containsPreemptive(), gotoNextItem(), initialize(), logStack(), and run().
|
protected |
List of defined args.
Referenced by defineArg(), findArgReader(), and ~Aggregate().
|
protected |
Behavior list.
Referenced by containsPreemptive(), getChild(), getItemByRefId(), gotoNextItem(), initialize(), logStack(), preempted(), push(), run(), and uninitialize().
|
protected |
Index within parent aggregate.
Referenced by setIndex().
|
protected |
Number of children that are non-parallel.
Referenced by gotoNextItem(), and initialize().
|
protected |
Flag for parallel aggregates.
Referenced by initialize(), and setParallel().
List of Assign elements used for redefining Args.
Referenced by redefineArg(), run(), and ~Aggregate().
|
protected |
Alternate "reference" item.
Referenced by getRef(), initialize(), run(), setRef(), and uninitialize().
|
protected |
Item to make active when mission is resumed.
Referenced by initialize(), and setResumeItem().