Class ProcessChain

Class Documentation

class legion::core::scheduling::ProcessChain

Chain of processes that either run in a separate thread or on the main thread.

Note

If chain is to run on a separate thread, then the chain has it’s own program loop. ProcessChain::exit() needs to be called in order to end the thread.

Public Functions

ProcessChain() = default
ProcessChain(ProcessChain&&) = default
ProcessChain &operator=(ProcessChain&&) = default
template<size_type charc>
inline ProcessChain(const char (&name)[charc], Scheduler *scheduler)
bool run(bool low_power)

Creates a new thread and runs it’s own program loop in it.

Return

bool Scheduler::createThread() Scheduler::createThread()

inline id_type id()

Returns the hash of the name of the process-chain.

inline std::thread::id threadId()

Get id of the thread the chain runs on.

void exit()

Raises exit flag for this process-chain and will request the process thread to exit.

void runInCurrentThread()

Runs one iteration of the process-chains program loop without creating a new thread.

Note

Loops through all hooked processes and executes them until they are all finished.

void addProcess(Process *process)

Hook a process for execution with this chain.

void removeProcess(Process *process)

Unhook a process from execution with this chain.

Public Static Functions

static void threadedRun(ProcessChain *chain)
template<void(*)() func> static inline void subscribeToChainStart ()
template<void(*)() func> static inline void subscribeToChainEnd ()
template<void(*)() func> static inline void unsubscribeFromChainStart ()
template<void(*)() func> static inline void unsubscribeFromChainEnd ()