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 }
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
The input side of an active connection between two ports.
Definition: InputProtocol.h:38
The output side of an active connection between two ports.
InputProtocol * read() override
Block and wait for someone to talk to us.
Definition: FakeFace.cpp:29
void close() override
Stop listening.
Definition: FakeFace.cpp:25
bool open(const Contact &address) override
Start listening to the given address.
Definition: FakeFace.cpp:18
OutputProtocol * write(const Contact &address) override
Try to reach out and talk to someone.
Definition: FakeFace.cpp:35
A dummy two way stream for testing purposes.
Connection choreographer.
Definition: Protocol.h:34
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.
#define YARP_UNUSED(var)
Definition: api.h:159