...
This commit is contained in:
@@ -7,26 +7,43 @@ ABSTRACT DEVICE COMPONENTS LIBRARY
|
||||
*/
|
||||
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace adc
|
||||
{
|
||||
|
||||
|
||||
template <typename NetMessageT, typename IOImplT>
|
||||
class AdcNetService : public IOImplT
|
||||
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(ArgTs&&... args)
|
||||
auto asyncConnect(AdcNetServiceInterface::endpoint&& end_point, ArgTs&&... args)
|
||||
{
|
||||
return IOImplT::asyncConnect(end_point);
|
||||
}
|
||||
|
||||
|
||||
template <typename... ArgTs>
|
||||
auto asyncSend(NetMessageT&& msg, ArgTs&&... args)
|
||||
auto asyncSend(const NetMessageT& msg, ArgTs&&... args)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,7 +57,12 @@ public:
|
||||
/* blocking operations */
|
||||
|
||||
template <typename... ArgTs>
|
||||
auto send(NetMessageT&& msg, ArgTs&&... args)
|
||||
auto connect(const AdcNetServiceInterface::endpoint& end_point, ArgTs&&... args)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename... ArgTs>
|
||||
auto send(const NetMessageT& msg, ArgTs&&... args)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user