Example showing how to add a new carrier to YARP.
#include <stdio.h>
{
public:
virtual std::string
getName()
const override
{
return "test";
}
{
return "TESTTEST";
}
virtual Carrier *
create()
const override
{
return new TestCarrier();
}
};
int main(
int argc,
char *argv[])
{
if (bot!=NULL) {
printf(
"Got message %s\n", bot->
toString().c_str());
}
return 0;
}
A simple collection of objects that can be described and transmitted in a portable way.
void fromString(const std::string &text)
Initializes bottle from a string.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
T * read(bool shouldWait=true) override
Read an available object from the port.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
T & prepare()
Access the object which will be transmitted by the next call to yarp::os::BufferedPort::write.
static bool addCarrierPrototype(Carrier *carrier)
Add a new connection type.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
Utilities for manipulating the YARP network, including initialization and shutdown.
Communicating between two ports via a plain-text protocol.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
Carrier * create() const override
Factory method.
virtual std::string getSpecifierName() const
The main, catch-all namespace for YARP.
int main(int argc, char *argv[])