WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
warpos::Scheduler Class Reference

Base class implementation of the scheduler. More...

#include <Scheduler.h>

Inheritance diagram for warpos::Scheduler:

Public Member Functions

 Scheduler ()
 Constructor for the scheduler.
virtual int16 startup ()
 Function to start and configure the scheduler.
virtual int16 step (const clockwerk::Time &step_val)
 Function to step the scheduler by a single step.
virtual int16 run ()
 Function to run the scheduler until pre-determined end conditions identified/calculated by the scheduler.
virtual int16 registerApp (App &app, int16 slot)
 Function to register apps with the scheduler. Depending on the scheduler implementation these may be unused.
virtual int16 unregisterApp (int16 slot)
 Function to unregister a certain schedule slot.
void terminate ()
 Terminate the scheduler.
bool isTerminated ()
 Get whether scheduler is terminated.
void setExecutive (FlightExecutive *exc)
 Set the flight executive for the scheduler.
Public Member Functions inherited from clockwerk::GraphTreeObject
 GraphTreeObject (const char *gt_nme="", GraphTreeObject **storage_array=nullptr, uint32 storage_size=0)
 Name-based constructor for GraphTreeObject which will have no children by default.
virtual ~GraphTreeObject ()
 Destructor.
GraphTreeObjectparent ()
 Functions to get object's parent/children.
GraphTreeObject ** children ()
GraphTreeObjectchildAtIndex (uint8 i) const
int16 parent (GraphTreeObject *new_parent)
 Function to assign the node's parent via pointer.
int16 parent (GraphTreeObject &new_parent)
 Function to assign the node's parent via reference.
uint8 nChildren () const
 Getters for number of children and descendants.
uint16 nDescendants () const
uint8 capacity () const
const char * name () const
 Getter and setter for object name.
int16 name (const char *new_name)
uint8 rank ()
 Getter for the object rank.
int8 type ()
 Function to indicate type – -1 by default unless implemented downstream.
bool loggable ()
 Getter for object logability flag – note no setter because should only be set by this or a derived class in its definition.
GraphTreeObjectgetRootDataPointer ()
 Get the pointer to the highest object in the graph tree.
virtual int16 str (char *output, size_t size) const
 Get object represented as string.
virtual int16 fromStr (const char *val)
 Set value of graphtreeobject from string.

Protected Attributes

bool _is_terminated = false
 Flag to indicate whether the scheduler is terminated.
FlightExecutive_exc_ptr
 Pointer to the executive which may optionally be registered with scheduler.
Protected Attributes inherited from clockwerk::GraphTreeObject
GraphTreeObject_parent = nullptr
GraphTreeObject ** _children_ptr = nullptr
uint32 _max_num_children = 0
uint16 _num_descendants = 0
char _name [MAXIMUM_NAME_CHARS] = ""
 String name for object.
uint8 _num_children = 0
 Number of direct children of the tree (not including the tree itself).
uint8 _rank = 0
int8 _graph_tree_type = BASE_GRAPH_TREE
 Variable to store graph tree object type.
bool _loggable = false
 Variable to indicate whether the selected object is loggable. Set to false by default.
uint32 _index = 0
 Index pointing to the next write location for the graph tree children.

Additional Inherited Members

Protected Member Functions inherited from clockwerk::GraphTreeObject
int16 _setStorage (GraphTreeObject **storage_array, uint8 storage_size)
 Getter for object's string address.
void _recalculateDescendants ()
 Function to recursively re-calculate the number of descendants of a given node on the tree.
void _recalculateRank ()
 Function to recursively re-calculate the rank of a given node on the tree.
int16 _addChild (GraphTreeObject *child)
 Function to decompose a string into a series of substrings via indexing.
int16 _removeChild (GraphTreeObject *child)
 Function to remove a child from the graph node's children.

Detailed Description

Base class implementation of the scheduler.

This class is a base implementation of scheduler. It is an empty base class and cannot be used without implementation in a derived child class.

The scheduler is the engine that runs simulations and software. It defines the sequence and method of execution for models, tasks, monitors, and events and is tasked with their actual execution. It also manages faults and errors arising from them.

Constructor & Destructor Documentation

◆ Scheduler()

warpos::Scheduler::Scheduler ( )

Constructor for the scheduler.

Member Function Documentation

◆ isTerminated()

bool warpos::Scheduler::isTerminated ( )
inline

Get whether scheduler is terminated.

◆ registerApp()

int16 warpos::Scheduler::registerApp ( App & app,
int16 slot )
virtual

Function to register apps with the scheduler. Depending on the scheduler implementation these may be unused.

Parameters
appThe app to register
slotThe slot to register the app to
Returns
Error code corresponding to success/failure

Reimplemented in warpos::TableScheduler< N >, and warptwin::SimScheduler.

◆ run()

int16 warpos::Scheduler::run ( )
virtual

Function to run the scheduler until pre-determined end conditions identified/calculated by the scheduler.

Returns
Error code corresponding to success/failure
Note
The scheduler MUST define stopping conditions. Otherwise, will run indefinitely

Reimplemented in warpos::TableScheduler< N >, and warptwin::SimScheduler.

◆ setExecutive()

void warpos::Scheduler::setExecutive ( FlightExecutive * exc)
inline

Set the flight executive for the scheduler.

Parameters
excThe flight executive

◆ startup()

int16 warpos::Scheduler::startup ( )
virtual

Function to start and configure the scheduler.

Returns
Error code corresponding to success/failure

Reimplemented in warpos::TableScheduler< N >, and warptwin::SimScheduler.

◆ step()

int16 warpos::Scheduler::step ( const clockwerk::Time & step_val)
virtual

Function to step the scheduler by a single step.

Returns
Error code corresponding to success/failure

Reimplemented in warpos::TableScheduler< N >, and warptwin::SimScheduler.

◆ terminate()

void warpos::Scheduler::terminate ( )
inline

Terminate the scheduler.

◆ unregisterApp()

int16 warpos::Scheduler::unregisterApp ( int16 slot)
virtual

Function to unregister a certain schedule slot.

Parameters
slotSlot to unregister
Returns
Error code corresponding to success/failure

Reimplemented in warpos::TableScheduler< N >.

Member Data Documentation

◆ _exc_ptr

FlightExecutive* warpos::Scheduler::_exc_ptr
protected

Pointer to the executive which may optionally be registered with scheduler.

◆ _is_terminated

bool warpos::Scheduler::_is_terminated = false
protected

Flag to indicate whether the scheduler is terminated.


The documentation for this class was generated from the following files:
  • /Users/mickey/Documents/Projects/warptwin/warpos/src/flight/Scheduler.h
  • /Users/mickey/Documents/Projects/warptwin/warpos/src/flight/Scheduler.cpp