diff options
Diffstat (limited to 'profiling/common/include')
-rw-r--r-- | profiling/common/include/NetworkSockets.hpp | 4 | ||||
-rw-r--r-- | profiling/common/include/SocketConnectionException.hpp | 30 |
2 files changed, 29 insertions, 5 deletions
diff --git a/profiling/common/include/NetworkSockets.hpp b/profiling/common/include/NetworkSockets.hpp index 29575cdcd6..be94be6aa3 100644 --- a/profiling/common/include/NetworkSockets.hpp +++ b/profiling/common/include/NetworkSockets.hpp @@ -8,6 +8,8 @@ // is needed (typically just forwarding the parameters to a differently named function). // Some of the APIs are in fact completely identical and so no forwarding function is needed. +#if !defined(ARMNN_DISABLE_SOCKETS) + #pragma once #if defined(__unix__) || defined(__APPLE__) @@ -77,3 +79,5 @@ Socket Accept(Socket s, sockaddr* addr, socklen_t* addrlen, int flags); } // namespace arm } // namespace pipe + +#endif diff --git a/profiling/common/include/SocketConnectionException.hpp b/profiling/common/include/SocketConnectionException.hpp index 42b8d9d67e..f4ed2ebb23 100644 --- a/profiling/common/include/SocketConnectionException.hpp +++ b/profiling/common/include/SocketConnectionException.hpp @@ -20,24 +20,42 @@ namespace pipe class SocketConnectionException : public std::exception { public: - explicit SocketConnectionException(const std::string &message, arm::pipe::Socket socket) - : m_Message(message), m_Socket(socket), m_ErrNo(-1) {}; + explicit SocketConnectionException(const std::string& message +#if !defined(ARMNN_DISABLE_SOCKETS) + , arm::pipe::Socket socket +#endif + ) + : m_Message(message), +#if !defined(ARMNN_DISABLE_SOCKETS) + m_Socket(socket), +#endif + m_ErrNo(-1) {}; - explicit SocketConnectionException(const std::string &message, arm::pipe::Socket socket, int errNo) - : m_Message(message), m_Socket(socket), m_ErrNo(errNo) {}; + explicit SocketConnectionException(const std::string& message, +#if !defined(ARMNN_DISABLE_SOCKETS) + arm::pipe::Socket socket, +#endif + int errNo) + : m_Message(message), +#if !defined(ARMNN_DISABLE_SOCKETS) + m_Socket(socket), +#endif + m_ErrNo(errNo) {}; /// @return - Error message of SocketProfilingConnection - virtual const char *what() const noexcept override + virtual const char* what() const noexcept override { return m_Message.c_str(); } /// @return - Socket File Descriptor of SocketProfilingConnection /// or '-1', an invalid file descriptor +#if !defined(ARMNN_DISABLE_SOCKETS) arm::pipe::Socket GetSocketFd() const noexcept { return m_Socket; } +#endif /// @return - errno of SocketProfilingConnection int GetErrorNo() const noexcept @@ -47,7 +65,9 @@ public: private: std::string m_Message; +#if !defined(ARMNN_DISABLE_SOCKETS) arm::pipe::Socket m_Socket; +#endif int m_ErrNo; }; } // namespace pipe |