This commit is contained in:
Ilusha 2024-03-07 12:27:32 +03:00
parent b906e0e66c
commit 20ac8620e6
20 changed files with 86 additions and 853 deletions

View file

@ -0,0 +1,41 @@
#pragma once
#include "ConnectionCommon.hpp"
#include "List.hpp"
namespace tp {
class RemoteConnectionContext;
class RemoteConnection : public Connection {
public:
class Location {
ualni mId = 0;
public:
Location() = default;
};
public:
RemoteConnection(){ MODULE_SANITY_CHECK(gModuleConnection) };
virtual ~RemoteConnection() {
if (mStatus.isOpened()) RemoteConnection::disconnect();
}
public:
virtual bool connect(const Location& location, const Type& connectionInfo);
virtual bool disconnect();
public:
virtual const Location& getLocation() { return mLocation; }
public:
virtual bool readBytes(Byte* bytes, SizeBytes size);
virtual bool writeBytes(const Byte* bytes, SizeBytes size);
private:
RemoteConnectionContext* mHandle = nullptr;
Location mLocation;
};
}

View file

@ -0,0 +1,11 @@
#include "RemoteConnection.hpp"
#include "Testing.hpp"
using namespace tp;
TEST_DEF_STATIC(Simple) {
TEST(false);
}
TEST_DEF(RemoteConnection) { testSimple(); }