YARP
Yet Another Robot Platform
NameService.cpp
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 
9 
10 using namespace yarp::name;
11 using namespace yarp::os;
12 
15  const yarp::os::Contact& /*remote*/)
16 {
17  DummyConnector din;
18  DummyConnector dout;
19  din.setTextMode(true);
20  dout.setTextMode(true);
21  in.write(din.getWriter());
23  bool ok = handler.apply(din.getReader(), &dout.getWriter(), false);
24  out.read(dout.getReader());
25  return ok;
26 }
static void handler(int sig)
Definition: RFModule.cpp:241
Manage a single connection to the name server.
bool process(yarp::os::PortWriter &in, yarp::os::PortReader &out, const yarp::os::Contact &remote) override
Definition: NameService.cpp:13
Represents how to reach a part of a YARP network.
Definition: Contact.h:36
A dummy connection to test yarp::os::Portable implementations.
ConnectionWriter & getWriter()
Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was las...
void setTextMode(bool textmode)
Set the textMode of the dummy connection.
ConnectionReader & getReader(ConnectionWriter *replyWriter=nullptr)
Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was las...
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:25
virtual bool read(ConnectionReader &reader)=0
Read this object from a network connection.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.
Classes for constructing name servers.
An interface to the operating system, including Port based communication.