deskflow/src/lib/ipc/IpcMessage.cpp

39 lines
968 B
C++
Raw Normal View History

2012-07-02 13:45:52 +00:00
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2012 Nick Bolton
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
2012-07-02 13:45:52 +00:00
*/
#include "ipc/IpcMessage.h"
#include "common/ipc.h"
2012-07-02 13:45:52 +00:00
IpcMessage::IpcMessage(IpcMessageType type) : m_type(type)
{
}
2012-07-02 13:45:52 +00:00
IpcHelloMessage::IpcHelloMessage(IpcClientType clientType) : IpcMessage(IpcMessageType::Hello), m_clientType(clientType)
{
}
IpcHelloBackMessage::IpcHelloBackMessage() : IpcMessage(IpcMessageType::HelloBack)
{
}
IpcShutdownMessage::IpcShutdownMessage() : IpcMessage(IpcMessageType::Shutdown)
{
}
IpcLogLineMessage::IpcLogLineMessage(const std::string &logLine)
: IpcMessage(IpcMessageType::LogLine),
m_logLine(logLine)
{
}
IpcCommandMessage::IpcCommandMessage(const std::string &command, bool elevate)
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
: IpcMessage(IpcMessageType::Command),
m_command(command),
m_elevate(elevate)
{
}