YARP
Yet Another Robot Platform
TcpAcceptor.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_OS_IMPL_TCPACCEPTOR_H
7 #define YARP_OS_IMPL_TCPACCEPTOR_H
8 
9 #if defined(YARP_HAS_ACE)
10 # include <ace/SOCK_Acceptor.h>
11 # include <ace/config.h>
12 // In one the ACE headers there is a definition of "main" for WIN32
13 # ifdef main
14 # undef main
15 # endif
16 #elif defined(__unix__)
18 #else
19 YARP_COMPILER_ERROR(Cannot implement TcpAcceptor on this platform)
20 #endif
21 
22 namespace yarp {
23 namespace os {
24 namespace impl {
25 
26 #ifdef YARP_HAS_ACE
27 typedef ACE_SOCK_Acceptor TcpAcceptor;
28 #elif defined(__unix__)
29 typedef yarp::os::impl::posix::TcpAcceptor TcpAcceptor;
30 #endif
31 
32 } // namespace impl
33 } // namespace os
34 } // namespace yarp
35 
36 #endif // YARP_OS_IMPL_TCPACCEPTOR_H
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_COMPILER_ERROR(x)
Generate an error at build time on supported compilers.
Definition: system.h:110