YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
RpcServer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_RPCSERVER_H
8#define YARP_OS_RPCSERVER_H
9
11
12namespace yarp::os {
13
23{
24public:
28 RpcServer();
29
33 ~RpcServer() override;
34
38 virtual bool write(const PortWriter& writer,
39 const PortWriter* callback = nullptr) const override;
40
44 virtual bool write(const PortWriter& writer,
45 PortReader& reader,
46 const PortWriter* callback = nullptr) const override;
47
48 // documented in UnbufferedContactable
49 bool read(PortReader& reader, bool willReply = true) override;
50
51 void setInputMode(bool expectInput) override;
52 void setOutputMode(bool expectOutput) override;
53 void setRpcMode(bool expectRpc) override;
54
55 Port& asPort() override
56 {
57 return port;
58 }
59
60 const Port& asPort() const override
61 {
62 return port;
63 }
64
65private:
66 // an RpcServer may be implemented with a regular port
67 Port port;
68
69 // forbid copy constructor and assignment operator by making them private
70 // and not implementing them
71 RpcServer(const RpcServer& alt);
72 const RpcServer& operator=(const RpcServer& alt);
73};
74
75} // namespace yarp::os
76
77#endif // YARP_OS_RPCSERVER_H
A default implementation of an abstract port.
A mini-server for performing network communication in the background.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition PortWriter.h:23
A mini-server for network communication.
Definition Port.h:46
A port that is specialized as an RPC server.
Definition RpcServer.h:23
const Port & asPort() const override
Get the concrete Port being used for communication, const version.
Definition RpcServer.h:60
Port & asPort() override
Get the concrete Port being used for communication.
Definition RpcServer.h:55
An interface to the operating system, including Port based communication.
#define YARP_os_API
Definition api.h:18