82 lines
1.5 KiB
C++
82 lines
1.5 KiB
C++
#pragma once
|
|
|
|
/*
|
|
|
|
ABSTRACT DEVICE COMPONENTS LIBRARY
|
|
|
|
*/
|
|
|
|
|
|
#include <utility>
|
|
|
|
namespace adc
|
|
{
|
|
|
|
|
|
template <typename IOImplT, typename NetMessageT>
|
|
class AdcNetServiceInterface : public IOImplT
|
|
{
|
|
protected:
|
|
AdcNetServiceInterface::socket _socket;
|
|
|
|
template <typename... IOImplCtorArgTs>
|
|
AdcNetServiceInterface(AdcNetServiceInterface::socket&& sock, IOImplCtorArgTs&&... args)
|
|
: IOImplT(std::forward<IOImplCtorArgTs>(args)...), _socket(sock)
|
|
{
|
|
}
|
|
|
|
public:
|
|
using typename IOImplT::endpoint;
|
|
using typename IOImplT::socket;
|
|
|
|
virtual ~AdcNetServiceInterface() = default;
|
|
|
|
|
|
/* asynchronuos operations */
|
|
|
|
// open connection
|
|
template <typename... ArgTs>
|
|
auto asyncConnect(AdcNetServiceInterface::endpoint&& end_point, ArgTs&&... args)
|
|
{
|
|
return IOImplT::asyncConnect(end_point);
|
|
}
|
|
|
|
|
|
template <typename... ArgTs>
|
|
auto asyncSend(const NetMessageT& msg, ArgTs&&... args)
|
|
{
|
|
}
|
|
|
|
template <typename... ArgTs>
|
|
auto asyncReceive(ArgTs&&... args)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
/* blocking operations */
|
|
|
|
template <typename... ArgTs>
|
|
auto connect(const AdcNetServiceInterface::endpoint& end_point, ArgTs&&... args)
|
|
{
|
|
}
|
|
|
|
template <typename... ArgTs>
|
|
auto send(const NetMessageT& msg, ArgTs&&... args)
|
|
{
|
|
}
|
|
|
|
|
|
template <typename... ArgTs>
|
|
NetMessageT receive(ArgTs&&... args)
|
|
{
|
|
}
|
|
|
|
template <typename... ArgTs>
|
|
auto close(ArgTs&&... args)
|
|
{
|
|
}
|
|
};
|
|
|
|
} // namespace adc
|