Leosac  0.8.0
Open Source Access Control
Leosac::CoreAPI Class Reference

CoreAPI is a class for interact with Leosac's core. More...

#include <CoreAPI.hpp>

+ Collaboration diagram for Leosac::CoreAPI:

Public Member Functions

 CoreAPI (Kernel &k)
 
uint64_t config_version () const
 Retrieve the local configuration version. More...
 
boost::property_tree::ptree kernel_config () const
 Retrieve the property tree describing the Leosac's kernel configuration. More...
 
std::string instance_name () const
 Returns the instance_name of Leosac. More...
 
uint64_t uptime () const
 Returns the uptime, in seconds. More...
 
void restart_server () const
 Request that Leosac restarts. More...
 
std::vector< std::string > modules_names () const
 Retrieve the names of all enabled modules. More...
 

Private Attributes

Kernelkernel_
 

Detailed Description

CoreAPI is a class for interact with Leosac's core.

This class is intended to be used by modules, as a way to retrieve information from Leosac's Kernel in a clean way.

This class uses message passing / tasks scheduling internally, and expose an easy to use API to client code.

Note
This object itself is NOT thread safe. However it provides a safe way to interact with the core.
Warning
You SHALL NOT use this class from the main thread.

Definition at line 47 of file CoreAPI.hpp.

Constructor & Destructor Documentation

◆ CoreAPI()

CoreAPI::CoreAPI ( Kernel k)
explicit

Definition at line 31 of file CoreAPI.cpp.

Member Function Documentation

◆ config_version()

uint64_t CoreAPI::config_version ( ) const

Retrieve the local configuration version.

Definition at line 36 of file CoreAPI.cpp.

◆ instance_name()

std::string CoreAPI::instance_name ( ) const

Returns the instance_name of Leosac.

Definition at line 76 of file CoreAPI.cpp.

◆ kernel_config()

boost::property_tree::ptree CoreAPI::kernel_config ( ) const

Retrieve the property tree describing the Leosac's kernel configuration.

Definition at line 45 of file CoreAPI.cpp.

◆ modules_names()

std::vector< std::string > CoreAPI::modules_names ( ) const

Retrieve the names of all enabled modules.

Definition at line 90 of file CoreAPI.cpp.

◆ restart_server()

void CoreAPI::restart_server ( ) const

Request that Leosac restarts.

Definition at line 104 of file CoreAPI.cpp.

◆ uptime()

uint64_t CoreAPI::uptime ( ) const

Returns the uptime, in seconds.

Definition at line 60 of file CoreAPI.cpp.

Member Data Documentation

◆ kernel_

Kernel& Leosac::CoreAPI::kernel_
private

Definition at line 84 of file CoreAPI.hpp.


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