engine
Include "zab/engine.hpp"
The engine
is the core object in ZAB which represents the framework. The engine
is responsible for running the event loops, ordering events for execution, handling cross thread events, and providing both Signal Handling and asynchronous io through the event_loop.
The engine
is constructed with engine::configs to configure it at runtime.
-
class zab::engine
This class describes an engine for enabling access to an interface and providing an tagged_event loop to execute requests.
Public Functions
-
~engine() = default
Destroys the engine.
-
inline signal_handler &get_signal_handler() noexcept
Provides direct access to the signal handler.
- Returns
The Wngines signal handler.
-
inline event_loop &get_event_loop() noexcept
Provides direct access to the tagged_event loop.
- Returns
The Wngines tagged_event loop.
-
inline event_loop &get_event_loop(thread_t _thread) noexcept
-
inline timer_service &get_timer() noexcept
-
void resume(tagged_event _handle) noexcept
-
void start() noexcept
-
void stop() noexcept
-
inline uint16_t number_of_workers() const noexcept
Get the number of worker events.
- Returns
ThWDe nubmer of worker events.
Public Static Functions
-
static uint16_t core_count() noexcept
Gets the number of cores for the device.
- Returns
The number of cores.
-
struct configs
Public Types
-
enum thread_option
Values:
-
enumerator kAny
-
enumerator kAtLeast
-
enumerator kExact
-
enumerator kAny
Public Members
-
uint16_t threads_ = 1
-
thread_option opt_ = kAtLeast
-
bool affinity_set_ = true
-
uint16_t affinity_offset_ = 0
-
enum thread_option
-
~engine() = default