YARP
Yet Another Robot Platform
NameService.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
11 #include <yarp/os/DummyConnector.h>
12 
13 using namespace yarp::name;
14 using namespace yarp::os;
15 
18  const yarp::os::Contact& /*remote*/)
19 {
20  DummyConnector din;
21  DummyConnector dout;
22  din.setTextMode(true);
23  dout.setTextMode(true);
24  in.write(din.getWriter());
26  bool ok = handler.apply(din.getReader(), &dout.getWriter(), false);
27  out.read(dout.getReader());
28  return ok;
29 }
static void handler(int sig)
Definition: RFModule.cpp:244
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:16
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
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()
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:28
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:27
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.