From 6d7704c1b497341fd6dd3c27e3f64d0db062ccc2 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 4 Feb 2019 11:06:18 +0100 Subject: [HICN-11] Rework on transport protocols improving components modularity Change-Id: I6683ec5b494238dc93591c103d25275e89b9f267 Signed-off-by: Mauro Sardara --- .../src/hicn/transport/interfaces/socket.h | 133 +-------------------- 1 file changed, 6 insertions(+), 127 deletions(-) (limited to 'libtransport/src/hicn/transport/interfaces/socket.h') diff --git a/libtransport/src/hicn/transport/interfaces/socket.h b/libtransport/src/hicn/transport/interfaces/socket.h index 14ef86422..7d50d0fbd 100644 --- a/libtransport/src/hicn/transport/interfaces/socket.h +++ b/libtransport/src/hicn/transport/interfaces/socket.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,8 @@ namespace transport { namespace protocol { class IcnObserver; -} +class TransportStatistics; +} // namespace protocol namespace interface { @@ -77,6 +79,7 @@ using BasePortal = HicnForwarderPortal; using PayloadType = core::PayloadType; using Prefix = core::Prefix; using Array = utils::Array; +using ContentBuffer = std::shared_ptr>; using ConsumerInterestCallback = std::function; @@ -84,9 +87,8 @@ using ConsumerInterestCallback = using ConsumerContentCallback = std::function; -using ConsumerTimerCallback = - std::function; +using ConsumerTimerCallback = std::function; using ProducerContentCallback = std::function; @@ -132,129 +134,6 @@ class Socket { virtual void connect() = 0; - virtual int setSocketOption(int socket_option_key, - uint32_t socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - double socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - bool socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - core::Name socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - std::list socket_option_value) = 0; - - virtual int setSocketOption( - int socket_option_key, - ProducerContentObjectCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ProducerInterestCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ProducerContentCallback socket_option_value) = 0; - - virtual int setSocketOption( - int socket_option_key, - ConsumerContentObjectVerificationCallback socket_option_value) = 0; - - virtual int setSocketOption( - int socket_option_key, - ConsumerContentObjectCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerInterestCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerContentCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerManifestCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - IcnObserver *socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - core::HashAlgorithm socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - utils::CryptoSuite socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - const utils::Identity &socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerTimerCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - const std::string &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - uint32_t &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - double &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - bool &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - core::Name &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - std::list &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, - ProducerContentObjectCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, ProducerInterestCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, - ConsumerContentObjectVerificationCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, - ConsumerContentObjectCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, ConsumerInterestCallback &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - ConsumerContentCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, ConsumerManifestCallback &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - ProducerContentCallback &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - std::shared_ptr &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - IcnObserver **socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - core::HashAlgorithm &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - utils::CryptoSuite &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - utils::Identity &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - std::string &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - ConsumerTimerCallback &socket_option_value) = 0; - protected: virtual ~Socket(){}; -- cgit 1.2.3-korg