adds ui namespace module
This commit is contained in:
1 parent
19f5a8a49a
commit
13dfbeddc0
9 files changed
+79
-5
No files matched your search
@@ -3,5 +3,6 @@ add_subdirectory(resolver)
|
||||
add_subdirectory(dhcp)
|
||||
add_subdirectory(api)
|
||||
add_subdirectory(cluster)
|
||||
add_subdirectory(ui)
|
||||
|
||||
|
||||
File renamed without changes.
@@ -8,4 +8,4 @@ add_subdirectory(storage)
|
||||
|
||||
# Build Executable:
|
||||
add_executable(Plains main.cpp)
|
||||
target_link_libraries(Plains PRIVATE Core DNS Storage Resolver DHCP API Cluster)
|
||||
target_link_libraries(Plains PRIVATE Core DNS Storage Resolver DHCP API Cluster UI)
|
||||
+6
-4
@@ -1,5 +1,6 @@
|
||||
#include "Resolver.hpp"
|
||||
#include "Core.hpp"
|
||||
#include "UI.hpp"
|
||||
#include "Resolver.hpp"
|
||||
#include "DNS.hpp"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -14,7 +15,7 @@ using std::string;
|
||||
int main(int args, char **argv) {
|
||||
Logger logger(Logger::DEBUG);
|
||||
|
||||
logger.info.ln ("Starting PlaiNS...");
|
||||
logger.info.ln ("Starting PLAINS...");
|
||||
|
||||
vector<string> arguments;
|
||||
for ( unsigned index = 0; index < args; ++index ) {
|
||||
@@ -25,6 +26,7 @@ int main(int args, char **argv) {
|
||||
{
|
||||
ConfigManager cfg(logger, arguments);
|
||||
EventBus eventBus(logger);
|
||||
UI::Server uiServer(logger, eventBus);
|
||||
Resolver::Server resolver(logger, eventBus);
|
||||
|
||||
/*
|
||||
@@ -53,9 +55,9 @@ int main(int args, char **argv) {
|
||||
// End of Testcode
|
||||
|
||||
//resolver.run();
|
||||
logger.info.ln ("PlaiNS successfully started.");
|
||||
logger.info.ln ("PLAINS successfully started.");
|
||||
// Run something on main thread...
|
||||
logger.info.ln ("Shutting down PlaiNS. Good Bye!");
|
||||
logger.info.ln ("Shutting down PLAINS. Good Bye!");
|
||||
}
|
||||
catch (Exception& e) {
|
||||
logger.fatal << "Uncaught Exception: " << e.what() << Logger::commit;
|
||||
|
||||
@@ -98,7 +98,9 @@ Server::Server(Logger& logger, EventBus& eventBus)
|
||||
}
|
||||
|
||||
Server::~Server() {
|
||||
_logger.debug.ln ("Stopping Resolver...");
|
||||
_udpSocket->close();
|
||||
_logger.debug.ln ("Resolver stopped");
|
||||
}
|
||||
|
||||
//void Server::run() {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
add_library(UI OBJECT Server.cpp)
|
||||
|
||||
target_include_directories(UI PUBLIC include)
|
||||
|
||||
target_link_libraries(UI PRIVATE Core DNS PUBLIC Asio)
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "Server.hpp"
|
||||
|
||||
namespace Plains {
|
||||
namespace UI {
|
||||
|
||||
using asio::ip::tcp;
|
||||
|
||||
Server::Server(Logger& logger, EventBus& eventBus)
|
||||
: _logger(logger),
|
||||
_eventBus(eventBus)
|
||||
{
|
||||
_logger.debug.ln ("Starting UI Webserver...");
|
||||
_logger.debug.ln ("UI Webserver started");
|
||||
}
|
||||
|
||||
Server::~Server() {
|
||||
_logger.debug.ln ("Stopping UI Webserver...");
|
||||
_logger.debug.ln ("UI Webserver stopped");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}}
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef UI_SERVER_HPP
|
||||
#define UI_SERVER_HPP
|
||||
#include "asio.hpp"
|
||||
#include "Core.hpp"
|
||||
|
||||
namespace Plains {
|
||||
namespace UI {
|
||||
|
||||
using Core::EventBus;
|
||||
using Core::Logger;
|
||||
using Core::Exception;
|
||||
|
||||
|
||||
class Server
|
||||
{
|
||||
private:
|
||||
EventBus& _eventBus;
|
||||
Logger& _logger;
|
||||
asio::io_context _ioContext;
|
||||
asio::ip::tcp::endpoint _sender_endpoint;
|
||||
|
||||
public:
|
||||
Server(Logger& logger, EventBus& eventBus);
|
||||
~Server();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,5 @@
|
||||
#ifndef UI_HPP
|
||||
#define UI_HPP
|
||||
#include "Server.hpp"
|
||||
//Include further classes here
|
||||
#endif
|
||||
Reference in new issue
Block a user