-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90e0c4a
commit 480d0a1
Showing
7 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
cmake_minimum_required(VERSION 3.24) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_BUILD_TYPE RelWithDebInfo) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") | ||
|
||
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/../../vcpkg/scripts/buildsystems/vcpkg.cmake") | ||
set(VCPKG_MANIFEST_DIR ${CMAKE_SOURCE_DIR}/../../) | ||
|
||
project(CommandManager) | ||
|
||
add_library(CommandManager src/command_manager.cpp) | ||
|
||
target_include_directories(CommandManager PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${JWT_CPP_INCLUDE_DIRS}) | ||
#target_link_libraries(CommandManager PUBLIC Boost::asio PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) | ||
|
||
if(BUILD_TESTS) | ||
# Enable testing | ||
enable_testing() | ||
add_subdirectory(tests) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <boost/asio.hpp> | ||
#include <queue> | ||
|
||
namespace command_manager | ||
{ | ||
class CommandManager | ||
{ | ||
public: | ||
CommandManager(); | ||
~CommandManager() {}; | ||
|
||
template<typename T> | ||
boost::asio::awaitable<void> | ||
ProcessCommandsFromQueue(const std::function<T(std::string, std::string)> GetCommand); | ||
}; | ||
} // namespace command_manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <command_manager.hpp> | ||
|
||
#include <iostream> | ||
|
||
namespace command_manager | ||
{ | ||
CommandManager::CommandManager() {} | ||
|
||
template<typename T> | ||
boost::asio::awaitable<void> | ||
CommandManager::ProcessCommandsFromQueue(const std::function<T(std::string, std::string)> GetCommand) | ||
{ | ||
while (true) | ||
{ | ||
|
||
std::cout << "Getting command from queue" << std::endl; | ||
auto cmd = co_await GetCommand(); | ||
} | ||
} | ||
} // namespace command_manager |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters