|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_BUFFEREDPORT_H
11 #define YARP_OS_BUFFEREDPORT_H
89 bool open(
const std::string& name)
override;
92 bool open(
const Contact& contact,
bool registerName =
true)
override;
95 bool addOutput(
const std::string& name)
override;
98 bool addOutput(
const std::string& name,
const std::string& carrier)
override;
104 void close()
override;
120 std::string
getName()
const override;
165 void write(
bool forceStrict =
false);
185 void setStrict(
bool strict =
true)
override;
188 T*
read(
bool shouldWait =
true)
override;
213 void onRead(T& datum)
override;
256 void release(
void* handle)
override;
285 #ifndef YARP_NO_DEPRECATED // Since YARP 3.3
320 void attachIfNeeded();
321 bool sharedOpen(
Port& port);
329 #endif // YARP_OS_BUFFEREDPORT_H
#define YARP_WARNING_PUSH
Starts a temporary alteration of the enabled warnings.
void disableCallback() override
Remove a callback set up with useCallback()
bool addOutput(const std::string &name) override
Add an output connection to the specified port.
A base class for sources of typed data.
void waitForWrite()
Wait for any pending writes to complete.
bool lockCallback() override
Lock callbacks until unlockCallback() is called.
T * read(bool shouldWait=true) override
Read an available object from the port.
void release(void *handle) override
Return control to YARP of an object previously taken control of with the acquire() method.
void releaseProperties(Property *prop) override
End access unstructured port properties.
void setReplier(PortReader &reader) override
If a message is received that requires a reply, use this handler.
void getReport(PortReport &reporter) override
Get information on the state of the port - connections etc.
Buffer incoming data to a port.
Buffer outgoing data to a port.
A callback for typed data from a port.
void interrupt() override
Interrupt any current reads or writes attached to the port.
void unlockCallback() override
Unlock callbacks.
void setStrict(bool strict=true) override
Call this to strictly keep all messages, or allow old ones to be quietly dropped.
bool setEnvelope(PortWriter &envelope) override
Set an envelope (e.g., a timestamp) to the next message which will be sent.
virtual ~BufferedPort()
Destructor.
void promiseType(const Type &typ) override
Commit the port to a particular type of data.
A base class for objects that want information about port status changes.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
bool isClosed() override
Returns whether the port associated with this reader has been closed.
void setOutputMode(bool expectOutput) override
Configure the port to allow or forbid outputs.
T & prepare()
Access the object which will be transmitted by the next call to yarp::os::BufferedPort::write.
A mini-server for network communication.
A mini-server for performing network communication in the background.
int getOutputCount() override
Determine how many output connections this port has.
void writeStrict()
Write the current object being returned by BufferedPort::prepare, waiting until any previous sends ar...
void * acquire() override
Take control of the last object read.
bool isWriting() override
Report whether the port is currently writing data.
void resetReporter() override
Remove the callback which is called upon any future connections and disconnections to/from the port.
int getPendingReads() override
Get the number of objects ready to be read.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
int getInputCount() override
Determine how many connections are arriving into this port.
Property * acquireProperties(bool readOnly) override
Access unstructured port properties.
Type getType() override
Get the type of data the port has committed to send/receive.
void setReader(PortReader &reader) override
Set an external reader for port data.
void useCallback()
Use own onRead() method as callback.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void setReporter(PortReport &reporter) override
Set a callback to be called upon any future connections and disconnections to/from the port.
std::string getName() const override
Get name of port.
void setAdminReader(PortReader &reader) override
Set an external reader for unrecognized administrative port messages.
void setInputMode(bool expectInput) override
Configure the port to allow or forbid inputs.
#define YARP_WARNING_POP
Ends a temporary alteration of the enabled warnings.
Contact where() const override
Returns information about how this port can be reached.
void includeNodeInName(bool flag) override
Choose whether to prepend a node name (if one is available) to the port's name.
void onRead(T &datum) override
Callback method.
bool setCallbackLock(yarp::os::Mutex *mutex) override
Add a lock to use when invoking callbacks.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
BufferedPort()
Constructor.
T * lastRead() override
Get the last data returned by read()
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
bool unprepare()
Give the last prepared object back to YARP without writing it.
The main, catch-all namespace for YARP.
void close() override
Stop port activity.
bool removeCallbackLock() override
Remove a lock on callbacks added with setCallbackLock()
bool getEnvelope(PortReader &envelope) override
Get the envelope information (e.g., a timestamp) from the last message received on the port.
Basic wrapper for mutual exclusion.
bool tryLockCallback() override
Try to lock callbacks until unlockCallback() is called.
void setTargetPeriod(double period) override
Try to provide data periodically.
#define YARP_DISABLE_DEPRECATED_WARNING
Disable deprecated warnings in the following code.
void resume() override
Put the port back in an operative state after interrupt() has been called.
A class for storing options and configuration information.
void setRpcMode(bool expectRpc) override
Configure the port to be RPC only.
T ContentType
The type of content stored by this BufferedPort.