YARP
Yet Another Robot Platform
FakeFace.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #include <yarp/os/impl/FakeFace.h>
11 
13 #include <yarp/os/impl/Protocol.h>
14 
15 using namespace yarp::os::impl;
16 using namespace yarp::os;
17 
18 bool FakeFace::open(const Contact& address)
19 {
20  YARP_UNUSED(address);
21  // happy to open without fuss
22  return true;
23 }
24 
26 {
27 }
28 
30 {
31  fprintf(stderr, "not implemented\n");
32  return nullptr;
33 }
34 
36 {
37  YARP_UNUSED(address);
38  auto* prot = new Protocol(new FakeTwoWayStream());
39  return prot;
40 }
yarp::os::impl::FakeFace::close
void close() override
Stop listening.
Definition: FakeFace.cpp:25
yarp::os::OutputProtocol
The output side of an active connection between two ports.
Definition: OutputProtocol.h:33
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
FakeFace.h
Protocol.h
yarp::os::impl::FakeFace::read
InputProtocol * read() override
Block and wait for someone to talk to us.
Definition: FakeFace.cpp:29
yarp::os::impl::Protocol
Connection choreographer.
Definition: Protocol.h:34
yarp::os::impl::FakeFace::write
OutputProtocol * write(const Contact &address) override
Try to reach out and talk to someone.
Definition: FakeFace.cpp:35
yarp::os::impl::FakeFace::open
bool open(const Contact &address) override
Start listening to the given address.
Definition: FakeFace.cpp:18
yarp::os::impl::FakeTwoWayStream
A dummy two way stream for testing purposes.
Definition: FakeTwoWayStream.h:26
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yarp::os::Contact
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
yarp::os::InputProtocol
The input side of an active connection between two ports.
Definition: InputProtocol.h:38
yarp::os::impl
The components from which ports and connections are built.
FakeTwoWayStream.h