aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/unit_tests/shared/command.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-27 13:17:26 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-27 13:18:45 +0300
commit0c62070b24273e565cce112ab061df6665d3ae8c (patch)
treea9a36ef593871daef57986fbfbbfb44de8c1116d /test/unit_tests/shared/command.hpp
parentBoost.Test is broken in 1.62 (diff)
downloadwinapi-common-0c62070b24273e565cce112ab061df6665d3ae8c.tar.gz
winapi-common-0c62070b24273e565cce112ab061df6665d3ae8c.zip
code style
Don't use brace initialization in constructors, VS 2013 doesn't like that.
Diffstat (limited to 'test/unit_tests/shared/command.hpp')
-rw-r--r--test/unit_tests/shared/command.hpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/unit_tests/shared/command.hpp b/test/unit_tests/shared/command.hpp
index 266903f..4a91370 100644
--- a/test/unit_tests/shared/command.hpp
+++ b/test/unit_tests/shared/command.hpp
@@ -33,15 +33,6 @@ BOOST_STATIC_CONSTEXPR auto COMMAND_SHMEM_NAME = "shmem-test-cmd";
class Command {
public:
- typedef winapi::SharedObject<Command> Shared;
-
- static Shared create() { return Shared::create(COMMAND_SHMEM_NAME); }
- static Shared open() { return Shared::open(COMMAND_SHMEM_NAME); }
-
- typedef boost::interprocess::interprocess_mutex mutex;
- typedef boost::interprocess::interprocess_condition condition_variable;
- typedef boost::interprocess::scoped_lock<mutex> lock;
-
enum Action {
EXIT = 1,
GET_CONSOLE_WINDOW,
@@ -62,8 +53,18 @@ public:
fixed_size::StringList<> console_buffer;
};
+ typedef winapi::SharedObject<Command> Shared;
+
+ typedef boost::interprocess::interprocess_mutex mutex;
+ typedef boost::interprocess::interprocess_condition condition_variable;
+ typedef boost::interprocess::scoped_lock<mutex> lock;
+
typedef std::function<void(Args&)> SetArgs;
typedef std::function<void(const Result&)> ReadResult;
+ typedef std::function<void(Action, const Args&, Result&)> ProcessAction;
+
+ static Shared create() { return Shared::create(COMMAND_SHMEM_NAME); }
+ static Shared open() { return Shared::open(COMMAND_SHMEM_NAME); }
void get_result(Action action, const SetArgs& set_args, const ReadResult& read_result) {
{
@@ -104,8 +105,6 @@ public:
return get_result(action, [](const Result&) {});
}
- typedef std::function<void(Action, const Args&, Result&)> ProcessAction;
-
void process_action(const ProcessAction& callback) {
{
lock lck{m_mtx};