EHS/include/ehs/io/socket/ehc/NetSys.h

50 lines
767 B
C++

#pragma once
#include "ehs/Str.h"
#include "ehs/Array.h"
#include "ehs/Serializer.h"
namespace ehs
{
class NetChannel;
class NetEnd;
class NetOp;
class NetSys
{
private:
friend class NetChannel;
friend class NetServerCh;
friend class NetClientCh;
UInt_64 id;
Str_8 name;
Array<NetOp*> ops;
public:
virtual ~NetSys();
NetSys();
NetSys(Str_8 name);
NetSys(NetSys &&sys) noexcept;
NetSys(const NetSys &sys);
NetSys &operator=(NetSys &&sys) noexcept;
NetSys &operator=(const NetSys &sys);
UInt_64 GetId() const;
Str_8 GetName() const;
bool HasOperation(UInt_64 id) const;
bool AddOperation(NetOp *op);
private:
void Execute(NetChannel *channel, NetEnd *issuer, UInt_64 opId, Serializer<UInt_64> &payload);
};
}