#include <root.hpp>
Public Member Functions | |
Root () | |
Default constructor. More... | |
Root (Component *parent) | |
Construct from a parent. More... | |
Root (const Root &)=delete | |
Root & | operator= (const Root &)=delete |
Root (Root &&)=delete | |
Root & | operator= (Root &&)=delete |
virtual | ~Root ()=default |
boost::asio::io_context & | context () override |
Obtain a reference to the underlying I/O context. More... | |
virtual void | run () |
Run the event loop. More... | |
virtual void | stop () |
Stop the event loop and exit. More... | |
Public Member Functions inherited from kouta::base::Component | |
Component ()=delete | |
Component (Component *parent) | |
Constructor. More... | |
Component (const Component &)=delete | |
Component & | operator= (const Component &)=delete |
Component (Component &&)=delete | |
Component & | operator= (Component &&)=delete |
virtual | ~Component () |
Component destructor. More... | |
void | add_child (Component *component) |
Add a child component to the list. More... | |
void | remove_child (Component *component) |
Remove a child component from the list. More... | |
template<class TClass , class... TMethodArgs, class... TArgs> | |
void | post (void(TClass::*method)(TMethodArgs...), TArgs... args) |
Post a method call to the event loop for deferred execution. More... | |
template<class... TFuncArgs, class... TArgs> | |
void | post (const std::function< void(TFuncArgs...)> &functor, TArgs... args) |
Post a function call to the event loop for deferred execution. More... | |
template<class TFunctor > | |
void | post (TFunctor &&functor) |
Post a functor call to the event loop for deferred execution. More... | |
Private Attributes | |
boost::asio::io_context | m_context |
Root component.
As opposed to a regular Component, the Root does own the event loop and is in charge of running it and acting as the entry-point to the rest of the application.
|
inline |
Default constructor.
This constructor assumes that the Root object will not have a parent (e.g. it is the main object of the tree), meaning that it will not attempt to register itself with the parent, nor remove itself from its list when being destroyed.
|
inlineexplicit |
|
delete |
|
delete |
|
virtualdefault |
|
inlineoverridevirtual |
Obtain a reference to the underlying I/O context.
Reimplemented from kouta::base::Component.
|
inlinevirtual |
Run the event loop.
Reimplemented in kouta::base::Branch< TWrapped >.
|
inlinevirtual |
Stop the event loop and exit.
|
private |