5 #ifndef HERALD_ACTIVITIES_H
6 #define HERALD_ACTIVITIES_H
8 #include "../context.h"
9 #include "../datatype/data.h"
10 #include "../datatype/target_identifier.h"
40 namespace Priorities {
52 using Prerequisite = std::tuple<FeatureTag,std::optional<TargetIdentifier>>;
105 virtual std::vector<PrioritisedPrerequisite>
provision(
const std::vector<PrioritisedPrerequisite>& requested) = 0;
The main data workhorse class of the Herald API.
Definition: data.h:33
Coordination management class that arranges Sensor's periodic requirements and activity interdependen...
Definition: activities.h:93
virtual std::vector< PrioritisedPrerequisite > requiredConnections()=0
Get a list of what connections are required to which devices now (may start, maintain,...
virtual std::vector< FeatureTag > connectionsProvided()=0
What connections does this Sensor type provide for Coordination.
virtual std::vector< Activity > requiredActivities()=0
Get a list of activities that are currently outstanding in this iteration.
virtual std::vector< PrioritisedPrerequisite > provision(const std::vector< PrioritisedPrerequisite > &requested)=0
Runtime connection provisioning (if it isn't requested, it can be closed)
Contains all low-level Herald datatype implementations.
Definition: base64_string.h:14
DataRef<> Data
Defaults references to Data to equal the DataRef with the default Memory Arena dimensions,...
Definition: data.h:506
std::tuple< FeatureTag, Priority, std::optional< TargetIdentifier > > PrioritisedPrerequisite
a Presrequisite with a relative priority assigned to assist Herald to prioritise effectively.
Definition: activities.h:54
std::tuple< FeatureTag, std::optional< TargetIdentifier > > Prerequisite
An absolute prerequisite required before an activity can take place.
Definition: activities.h:52
std::function< std::optional< Activity >(const Activity)> ActivityFunction
A convenience Function alias that invokes an activity and optionally returns a follow-on activity.
Definition: activities.h:70
std::uint8_t Priority
A relative priority between different activities.
Definition: activities.h:34
Acts as a non-global memory arena for arbitrary classes.
Definition: aggregates.h:15
An activity that needs to be performed due to some state being achieved in a Sensor.
Definition: activities.h:75
std::string name
A human readable name for this activity used for logging.
Definition: activities.h:80
ActivityFunction executor
The Activity function to call when all prerequisites have been met. May not be called.
Definition: activities.h:84
std::vector< Prerequisite > prerequisites
A list of non-prioritised pre-requisities (priority is taken from the priority field in Activity).
Definition: activities.h:82
Priority priority
The relative priority for this Activity compared to the scale.
Definition: activities.h:78