YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
PortReaderBufferBase.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_PORTREADERBUFFERBASE_H
8#define YARP_OS_PORTREADERBUFFERBASE_H
9
10#include <yarp/os/PortReader.h>
11
12#include <string>
13
14namespace yarp::os {
15
16class Port;
17class PortReaderBufferBaseCreator;
18class PortWriter;
19
22{
23public:
24 PortReaderBufferBase(unsigned int maxBuffer);
25 virtual ~PortReaderBufferBase();
26
27 void setCreator(PortReaderBufferBaseCreator* creator);
28
29 void setReplier(yarp::os::PortReader& reader);
30
31 void setPrune(bool flag = true);
32
33 void setTargetPeriod(double period);
34
35 std::string getName() const;
36
37 unsigned int getMaxBuffer();
38
39 bool isClosed();
40
41 void clear();
42
43 virtual yarp::os::PortReader* create();
44
45 int check();
46
47 bool read(yarp::os::ConnectionReader& connection) override;
48
49 yarp::os::PortReader* readBase(bool& missed, bool cleanup);
50
51 void interrupt();
52
53 void attachBase(yarp::os::Port& port);
54
55 // direct writer-buffer to reader-buffer pointer sharing methods
56
57 virtual bool acceptObjectBase(yarp::os::PortReader* obj,
59
60 virtual bool forgetObjectBase(yarp::os::PortReader* obj,
62
63 virtual bool getEnvelope(PortReader& envelope);
64
65 // user takes control of the current read object
66 void* acquire();
67
68 // user gives back an object
69 void release(void* key);
70
71#ifndef DOXYGEN_SHOULD_SKIP_THIS
72private:
73 class Private;
74 Private* mPriv;
75#endif // DOXYGEN_SHOULD_SKIP_THIS
76};
77
78
79} // namespace yarp::os
80
81#endif // YARP_OS_PORTREADERBUFFERBASE_H
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition PortWriter.h:23
A mini-server for network communication.
Definition Port.h:46
An interface to the operating system, including Port based communication.
#define YARP_os_API
Definition api.h:18