meso: KPort mini skeleton
This commit is contained in:
34
mesosphere/include/mesosphere/processes/KClientPort.hpp
Normal file
34
mesosphere/include/mesosphere/processes/KClientPort.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <mesosphere/core/KSynchronizationObject.hpp>
|
||||
#include <mesosphere/core/util.hpp>
|
||||
#include <mesosphere/core/Result.hpp>
|
||||
#include <mesosphere/interfaces/IClient.hpp>
|
||||
#include <mesosphere/threading/KThread.hpp>
|
||||
|
||||
namespace mesosphere
|
||||
{
|
||||
|
||||
class KPort;
|
||||
class KServerPort;
|
||||
|
||||
class KClientPort final :
|
||||
public KSynchronizationObject,
|
||||
public IClient<KPort, KClientPort, KServerPort> {
|
||||
|
||||
public:
|
||||
|
||||
MESOSPHERE_AUTO_OBJECT_TRAITS(SynchronizationObject, ClientPort);
|
||||
|
||||
virtual ~KClientPort();
|
||||
|
||||
virtual bool IsSignaled() const override;
|
||||
|
||||
private:
|
||||
friend class KPort;
|
||||
|
||||
};
|
||||
|
||||
MESOSPHERE_AUTO_OBJECT_DEFINE_INCREF(ClientPort);
|
||||
|
||||
}
|
||||
36
mesosphere/include/mesosphere/processes/KPort.hpp
Normal file
36
mesosphere/include/mesosphere/processes/KPort.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <mesosphere/core/util.hpp>
|
||||
#include <mesosphere/core/Result.hpp>
|
||||
#include <mesosphere/interfaces/IClientServerParent.hpp>
|
||||
#include <mesosphere/interfaces/ISetAllocated.hpp>
|
||||
#include <mesosphere/processes/KClientPort.hpp>
|
||||
#include <mesosphere/processes/KServerPort.hpp>
|
||||
|
||||
namespace mesosphere
|
||||
{
|
||||
|
||||
class KPort final :
|
||||
public KAutoObject,
|
||||
public ISetAllocated<KPort>,
|
||||
public IClientServerParent<KPort, KClientPort, KServerPort> {
|
||||
|
||||
public:
|
||||
MESOSPHERE_AUTO_OBJECT_TRAITS(AutoObject, Port);
|
||||
|
||||
virtual ~KPort();
|
||||
|
||||
Result Initialize();
|
||||
|
||||
private:
|
||||
friend class KClientPort;
|
||||
friend class KServerPort;
|
||||
|
||||
bool isClientAlive = false;
|
||||
bool isServerAlive = false;
|
||||
bool isLight = false;
|
||||
};
|
||||
|
||||
MESOSPHERE_AUTO_OBJECT_DEFINE_INCREF(Port);
|
||||
|
||||
}
|
||||
31
mesosphere/include/mesosphere/processes/KServerPort.hpp
Normal file
31
mesosphere/include/mesosphere/processes/KServerPort.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <mesosphere/core/KSynchronizationObject.hpp>
|
||||
#include <mesosphere/processes/KLightServerSession.hpp>
|
||||
|
||||
namespace mesosphere
|
||||
{
|
||||
|
||||
class KPort;
|
||||
class KClientPort;
|
||||
|
||||
class KServerPort final :
|
||||
public KSynchronizationObject,
|
||||
public IServer<KPort, KClientPort, KServerPort> {
|
||||
|
||||
public:
|
||||
|
||||
MESOSPHERE_AUTO_OBJECT_TRAITS(SynchronizationObject, ServerPort);
|
||||
|
||||
virtual ~KServerPort();
|
||||
|
||||
virtual bool IsSignaled() const override;
|
||||
|
||||
private:
|
||||
friend class KPort;
|
||||
|
||||
};
|
||||
|
||||
MESOSPHERE_AUTO_OBJECT_DEFINE_INCREF(ServerPort);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user