YARP
Yet Another Robot Platform
PortWriterBufferBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_OS_PORTWRITERBUFFERBASE_H
11 #define YARP_OS_PORTWRITERBUFFERBASE_H
12 
13 #include <yarp/os/PortWriter.h>
14 
15 namespace yarp {
16 namespace os {
17 
18 class Port;
19 
20 #ifndef DOXYGEN_SHOULD_SKIP_THIS
21 
22 class PortWriterBufferManager
23 {
24 public:
25  virtual ~PortWriterBufferManager();
26 
27  virtual void onCompletion(void* tracker) = 0;
28 };
29 
30 class PortWriterWrapper : public PortWriter
31 {
32 public:
33  virtual PortWriter* getInternal() = 0;
34 };
35 
36 #endif // DOXYGEN_SHOULD_SKIP_THIS
37 
38 
40 {
41 public:
43 
44  virtual ~PortWriterBufferBase();
45 
46  virtual PortWriterWrapper *create(PortWriterBufferManager& man, void *tracker) = 0;
47 
48  const void* getContent() const;
49 
50  bool releaseContent();
51 
52  int getCount();
53 
54  void attach(Port& port);
55 
56  void detach();
57 
58  void write(bool strict);
59 
60  void waitForWrite();
61 
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 private:
64  class Private;
65  Private* mPriv;
66 #endif // DOXYGEN_SHOULD_SKIP_THIS
67 };
68 
69 } // namespace os
70 } // namespace yarp
71 
72 #endif // YARP_OS_PORTWRITERBUFFERBASE_H
yarp::os::PortWriterBufferBase::Private
Definition: PortWriterBufferBase.cpp:28
YARP_os_API
#define YARP_os_API
Definition: api.h:19
PortWriter.h
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::os::PortWriterBufferBase::create
virtual PortWriterWrapper * create(PortWriterBufferManager &man, void *tracker)=0
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::PortWriterBufferBase
Definition: PortWriterBufferBase.h:40
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:971