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 }
yarp::os::DummyConnector
A dummy connection to test yarp::os::Portable implementations.
Definition: DummyConnector.h:35
yarp::os::PortReader::read
virtual bool read(ConnectionReader &reader)=0
Read this object from a network connection.
yarp::os::DummyConnector::getReader
ConnectionReader & getReader(ConnectionWriter *replyWriter=nullptr)
Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was las...
Definition: DummyConnector.cpp:117
yarp::os::PortWriter
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:27
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
handler
static void handler(int sig)
Definition: RFModule.cpp:244
DummyConnector.h
yarp::os::DummyConnector::getWriter
ConnectionWriter & getWriter()
Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was las...
Definition: DummyConnector.cpp:112
yarp::os::PortWriter::write
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.
NameService.h
yarp::name
Classes for constructing name servers.
Definition: BootstrapServer.h:18
yarp::os::DummyConnector::setTextMode
void setTextMode(bool textmode)
Set the textMode of the dummy connection.
Definition: DummyConnector.cpp:102
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yarp::name::NameService::process
bool process(yarp::os::PortWriter &in, yarp::os::PortReader &out, const yarp::os::Contact &remote) override
Definition: NameService.cpp:16
yarp::os::Contact
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
yarp::name::NameServerConnectionHandler
Manage a single connection to the name server.
Definition: NameServerConnectionHandler.h:40
NameServerConnectionHandler.h