sys_process

struct ModelScheduleEntry
#include <sys_process.h>

Structure that contains the information needed to call a Task.

Public Members

uint64_t NextTaskStart

Time to call Task next

uint64_t TaskUpdatePeriod

Period of update for Task

int32_t taskPriority

[-] Priority level for the task

SysModelTask *TaskPtr

Handle to the Task that needs to be called

class SysProcess
#include <sys_process.h>

Class used to group a set of tasks into one process (task group) of execution.

Public Functions

SysProcess() = default
explicit SysProcess(std::string name)

class method

Make a process AND attach a storage bucket with the provided name. Give the process the same name.

Returns:

void

~SysProcess() = default
void addNewTask(SysModelTask *newTask, int32_t taskPriority = -1)

class method

This method adds a new task into the Task list. Note that taskPriority parameter is option as it defaults to -1 (lowest)

Parameters:
  • newTask – The new task that we are adding to the list

  • taskPriority – The selected priority of the task being added

Returns:

void

void selfInitProcess()

class method

This method sets the nextTaskTime = 0 and calls SelfInitTaskList() for all process tasks.

Returns:

void

void resetProcess(uint64_t currentTime)

class method

This method resets each task and associated model-set inside the process ensuring that all parameters go back to their default state.

Parameters:

currentTime – Current simulation time in ns that reset is occurring at

Returns:

void

void reInitProcess()

class method

This method does two things: 1) resets the next task time for all process tasks to the first task time. 2) clears the process list and then adds everything back into the process with the correct priority.

Returns:

void

inline void enableProcess()

class method

inline void disableProcess()

class method

void scheduleTask(const ModelScheduleEntry &taskCall)

class method

This method is used to place the task from the caller into the correct place in the simulation schedule. The transaction for this model is that the caller will set the correct parameters in the calling argument and that the simulation will faithfully schedule it.

Parameters:

taskCall – Pointer to a struct that contains start time and task handle.

Returns:

void

inline void setProcessName(std::string const &newName)

class method

inline std::string const getProcessName()

class method

inline uint64_t getNextTime()

class method

void singleStepNextTask(uint64_t currentNanos)

class method

This method steps the next task up to currentNanos unless it isn’t supposed to run yet.

Returns:

void

inline bool processEnabled() const

class method

void changeTaskPeriod(const std::string &taskName, uint64_t newPeriod)

class method

This method updates a specified task’s period once it locates that task in the list. It will warn the user if a task is not found.

Parameters:
  • taskName – The name of the task you want to change period of

  • newPeriod – the new number of nanoseconds you want between calls

Returns:

void

inline void setPriority(int64_t newPriority)

class method

void disableAllTasks() const

class method

The name kind of says it all right? It is a shotgun used to disable all of a process’ tasks. It is handy for a FSW scheme where you have tons of tasks and you are really only turning one on at a time.

Returns:

void

void enableAllTasks() const

class method

The name kind of says it all right? It is a shotgun used to enable all of a processes tasks. It is handy for a process that starts out almost entirely inhibited but you want to turn it all on at once.

Returns:

void

inline bool getProcessControlStatus() const

Allows caller to see if this process is parented by a thread.

inline void setProcessControlStatus(bool processTaken)

Provides a mechanism to say that this process is allocated to a thread.

Public Members

std::vector<ModelScheduleEntry> processTasks

&#8212; Array that has pointers to all process tasks

uint64_t nextTaskTime = 0

[ns] time for the next Task

uint64_t prevRouteTime = 0

[ns] Time that interfaces were previously routed

std::string processName = {}

&#8212; Identifier for process

bool processActive = {}

&#8212; Flag indicating whether the Process is active

bool processOnThread = {}

&#8212; Flag indicating that the process has been added to a thread for execution

int64_t processPriority = -1

[-] Priority level for process (higher first)

BSKLogger bskLogger

&#8212; BSK Logging