Leosac  0.8.0
Open Source Access Control
CoreAPI.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "tools/ToolsFwd.hpp"
23 #include <boost/property_tree/ptree.hpp>
24 #include <cstdint>
25 #include <string>
26 #include <vector>
27 
28 namespace Leosac
29 {
30 
31 class Kernel;
32 
47 class CoreAPI
48 {
49  public:
50  explicit CoreAPI(Kernel &k);
51 
55  uint64_t config_version() const;
56 
61  boost::property_tree::ptree kernel_config() const;
62 
66  std::string instance_name() const;
67 
71  uint64_t uptime() const;
72 
76  void restart_server() const;
77 
81  std::vector<std::string> modules_names() const;
82 
83  private:
85 };
86 }
Leosac::CoreAPI::kernel_config
boost::property_tree::ptree kernel_config() const
Retrieve the property tree describing the Leosac's kernel configuration.
Definition: CoreAPI.cpp:45
Leosac::CoreAPI::restart_server
void restart_server() const
Request that Leosac restarts.
Definition: CoreAPI.cpp:104
ToolsFwd.hpp
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::CoreAPI::config_version
uint64_t config_version() const
Retrieve the local configuration version.
Definition: CoreAPI.cpp:36
Leosac::Kernel
Core of Leosac.
Definition: kernel.hpp:73
Leosac::CoreAPI::CoreAPI
CoreAPI(Kernel &k)
Definition: CoreAPI.cpp:31
Leosac::CoreAPI::uptime
uint64_t uptime() const
Returns the uptime, in seconds.
Definition: CoreAPI.cpp:60
Leosac::CoreAPI::kernel_
Kernel & kernel_
Definition: CoreAPI.hpp:84
Leosac::CoreAPI::instance_name
std::string instance_name() const
Returns the instance_name of Leosac.
Definition: CoreAPI.cpp:76
Leosac::CoreAPI::modules_names
std::vector< std::string > modules_names() const
Retrieve the names of all enabled modules.
Definition: CoreAPI.cpp:90
Leosac::CoreAPI
CoreAPI is a class for interact with Leosac's core.
Definition: CoreAPI.hpp:47