34template <
typename ImageType>
37 std::lock_guard<std::mutex> lock(m_mutex);
43 }
else if (reader.
check()) {
46 m_lastHeight =
image.height();
47 m_lastWidth =
image.width();
56 const std::string& remote,
57 const std::string& carrier)
59 std::lock_guard<std::mutex> lock(m_mutex);
61 if (!port.
open(local)) {
62 yCError(FRAMEGRABBER_NWC_YARP) <<
"Failed to open " << local <<
"port.";
65 if (!remote.empty()) {
66 yCInfo(FRAMEGRABBER_NWC_YARP) <<
"Connecting" << port.
getName() <<
"to" << remote;
68 yCError(FRAMEGRABBER_NWC_YARP) <<
"Failed to connect" << local <<
"to" << remote;
72 yCInfo(FRAMEGRABBER_NWC_YARP) <<
"No remote specified. Waiting for connection";
82 std::lock_guard<std::mutex> lock(m_mutex);
84 m_lastStamp = {0, 0.0};
101template bool StreamReceiver::lastImage<FlexImage>(
FlexImage&
image);
yarp::os::Stamp lastStamp() const
bool open(const std::string &local, const std::string &remote, const std::string &carrier)
bool lastImage(ImageType &image)
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.
T * read(bool shouldWait=true) override
Read an available object from the port.
virtual bool getEnvelope(PortReader &envelope)
bool check()
Check if data is available.
void attach(Port &port)
Attach this buffer to a particular port.
T * lastRead() override
Get the last data returned by read()
void interrupt() override
Interrupt any current reads or writes attached to the port.
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.
bool isOpen() const
Check if the port has been opened.
An abstraction for a time stamp and/or sequence number.
Image class with user control of representation details.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.