Elma
An event loop manager for embedded systems
Public Member Functions | List of all members
basic_example::BasicProcess Class Reference

Example: A very basic process class. See the file examples/basic.cc for usage. More...

+ Inheritance diagram for basic_example::BasicProcess:
+ Collaboration diagram for basic_example::BasicProcess:

Public Member Functions

 BasicProcess (std::string name)
 
void init ()
 Nothing to do to initialize.
 
void start ()
 Nothing to do to start.
 
void update ()
 The update method just prints out some useful information.
 
void stop ()
 Nothing to do to stop.
 
- Public Member Functions inherited from elma::Process
 Process (int n=0)
 Default constructor. Names process "no name".
 
 Process (std::string name, int n=0)
 Constructor that takes a name for the process. More...
 
string name ()
 
void set_name (std::string str)
 
status_type status ()
 
high_resolution_clock::duration period ()
 
int num_updates ()
 
time_point< high_resolution_clock > start_time ()
 
high_resolution_clock::duration last_update ()
 
high_resolution_clock::duration previous_update ()
 
Channelchannel (string name)
 Access a channel with the given name. More...
 
double milli_time ()
 The time since the last update in millisconds, as a double. More...
 
double delta ()
 The most recent amount of time between updates. More...
 
void watch (string event_name, std::function< void(Event &)> handler)
 
void emit (const Event &event)
 
void http_get (std::string url, std::function< void(json &)> handler)
 
void halt ()
 
void set_manager (Manager *m_ptr)
 

Additional Inherited Members

- Public Types inherited from elma::Process
enum  status_type { UNINITIALIZED, STOPPED, RUNNING }
 
- Protected Attributes inherited from elma::Process
Manager_manager_ptr
 

Detailed Description

Example: A very basic process class. See the file examples/basic.cc for usage.

This process does nothing except print out its name and the amount of time it has been running since it was started.

Definition at line 16 of file basic.cc.

Constructor & Destructor Documentation

◆ BasicProcess()

basic_example::BasicProcess::BasicProcess ( std::string  name)
inline

The constructor just wraps the base constructor.

Parameters
nameThe name of the process

Definition at line 21 of file basic.cc.


The documentation for this class was generated from the following file: