YARP
Yet Another Robot Platform
PortWriterBufferBase.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_PORTWRITERBUFFERBASE_H
8 #define YARP_OS_PORTWRITERBUFFERBASE_H
9 
10 #include <yarp/os/PortWriter.h>
11 
12 namespace yarp {
13 namespace os {
14 
15 class Port;
16 
17 #ifndef DOXYGEN_SHOULD_SKIP_THIS
18 
19 class PortWriterBufferManager
20 {
21 public:
22  virtual ~PortWriterBufferManager();
23 
24  virtual void onCompletion(void* tracker) = 0;
25 };
26 
27 class PortWriterWrapper : public PortWriter
28 {
29 public:
30  virtual PortWriter* getInternal() = 0;
31 };
32 
33 #endif // DOXYGEN_SHOULD_SKIP_THIS
34 
35 
37 {
38 public:
40 
41  virtual ~PortWriterBufferBase();
42 
43  virtual PortWriterWrapper *create(PortWriterBufferManager& man, void *tracker) = 0;
44 
45  const void* getContent() const;
46 
47  bool releaseContent();
48 
49  int getCount();
50 
51  void attach(Port& port);
52 
53  void detach();
54 
55  void write(bool strict);
56 
57  void waitForWrite();
58 
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60 private:
61  class Private;
62  Private* mPriv;
63 #endif // DOXYGEN_SHOULD_SKIP_THIS
64 };
65 
66 } // namespace os
67 } // namespace yarp
68 
69 #endif // YARP_OS_PORTWRITERBUFFERBASE_H
virtual PortWriterWrapper * create(PortWriterBufferManager &man, void *tracker)=0
A mini-server for network communication.
Definition: Port.h:47
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1098
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18