roviz  0.7
Code Documentation of roviz
stream_object.h
1 #ifndef STREAM_OBJECT_H
2 #define STREAM_OBJECT_H
3 
4 #include <memory>
5 #include <vector>
6 #include "core/template_decl.h"
7 #include "core/export_handling.h"
8 
9 struct SrcTreeNode;
11 
26 typedef std::shared_ptr<SrcTreeNode> SourceID;
27 
32 {
33  std::vector<SourceID> sources;
34 };
35 
39 class ROVIZ_EXPORT StreamObject
40 {
41  // Needed because we have to access the protected members of a StreamObject
42  // which is not 'this' in the conversion constructors of the derived classes.
43  MAKE_ALL_STREAMS_A_FRIEND
44 
45 public:
46  StreamObject();
47  virtual ~StreamObject() = default;
48 
53  SourceID id(void) const;
54 
55 protected:
56  std::shared_ptr<StreamObjectPrivate> _this_base;
57 
58  // Cannot be done in the constructer, because the derived class has to
59  // initialize the private data first.
60  void initSources(std::initializer_list<SourceID> sources = {});
61 
62  // C++ doesn't allow this, just make sure the object implements such a
63  // function.
64 // virtual static QWidget *initWidget(StreamBase *stream);
65 };
66 
67 DECLARE_STREAM_OBJECT(StreamObject)
68 
69 #endif // STREAM_OBJECT_H
Base class of all objects that can be transported with a stream.
Definition: stream_object.h:39
Private part of the StreamObject class.
Definition: stream_object_p.h:11
A node of the source-tree.
Definition: stream_object.h:31