Files
Plugin/Source/ThirdParty/include/SenseGlove/Connect/ConnectionData.hpp
T

119 lines
3.0 KiBLFS
C++

/**
* @file
*
* @author Max Lammers <max@senseglove.com>
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* Copyright (c) 2020 - 2022 SenseGlove
*
* @section DESCRIPTION
*
* A single piece of connection data with helper functions.
*/
#pragma once
#include <memory>
#include <string>
#include "Connection.hpp"
#include "Platform.hpp"
#include "PortInfo.hpp"
namespace SGConnect
{
class ConnectionData;
}
class SGConnect::ConnectionData
{
private:
struct Impl;
std::unique_ptr<Impl> Pimpl;
private:
ConnectionData();
public:
ConnectionData(const std::string& address, EConnectionType connectionType, bool bConnected);
/**
* The copy constructor.
*/
ConnectionData(const ConnectionData& rhs);
/**
* The move constructor.
*/
ConnectionData(ConnectionData&& rhs) noexcept;
virtual ~ConnectionData();
public:
/**
* The copy assignment operator.
*/
ConnectionData& operator=(const ConnectionData& rhs);
/**
* The move assignment operator.
*/
ConnectionData& operator=(ConnectionData&& rhs) noexcept;
public:
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
const std::string& GetAddress() const;
void SetAddress(const std::string& Address);
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
EConnectionType GetConnectionType() const;
void SetConnectionType(EConnectionType connectionType);
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
bool IsConnected() const;
void SetConnected(bool bConnected);
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
int32_t GetLastConnectCode() const;
void SetLastConnectCode(int32_t connectCode);
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
int32_t GetLastExitCode() const;
void SetLastExitCode(int32_t exitCode);
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
int32_t GetLastTestState() const;
void SetLastTestState(int32_t TestState);
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
int32_t GetDeviceType() const;
void SetDeviceType(int32_t DeviceType);
public:
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
bool Matches(const std::string& address, EConnectionType connectionType) const;
#if !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
[[nodiscard]]
#endif /* !defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
std::string Report() const;
};