AGX Dynamics  2.37.2.0
BufferEvent.Declaration.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 //-----------------------------------------------
18 // AUTOMATICALLY GENERATED EVENT, DO NOT EDIT!
19 //-----------------------------------------------
20 
21 #ifndef GENERATED_AGX_BUFFER_H_DECLARATION
22 #define GENERATED_AGX_BUFFER_H_DECLARATION
23 
24 #include <agx/macros.h>
25 
27 class EventDispatch;
28 
29 class AGXCORE_EXPORT EventListener
30 {
31 public:
32 
33  EventListener(agx::Object *owner = nullptr);
34  virtual ~EventListener();
35 
36  agx::Object* getOwner();
37  template <typename T>
38  T* getOwner();
39 
40  virtual void destroyCallback(agxData::Buffer* buffer);
41  virtual void resizeCallback(agxData::Buffer* buffer, agx::Index size, agx::Index oldSize);
42  virtual void updateCallback(agxData::Buffer* buffer);
43  virtual void updateCallback(agxData::Buffer* buffer, agx::Index index);
44  virtual void updateCallback(agxData::Buffer* buffer, agx::IndexRange range);
45  virtual void updateCallback(agxData::Buffer* buffer, agxData::Array< agx::Index > indexSet);
46 
47 private:
48  friend class EventDispatch;
49 private:
50  agx::Object* m_owner;
51  agx::UInt32 m_numRegistered;
52 };
53 
54 class AGXCORE_EXPORT EventDispatch
55 {
56 public:
57  EventDispatch();
58  ~EventDispatch();
59 
60 public:
61  void addListener(EventListener* listener);
62  void removeListener(EventListener* listener);
63  bool hasListener(EventListener* listener) const;
64 
66  const EventListenerPtrVector& getListeners() const;
67 
68 public:
69  void triggerDestroyEvent(agxData::Buffer* buffer);
70  void triggerResizeEvent(agxData::Buffer* buffer, agx::Index size, agx::Index oldSize);
71  void triggerUpdateEvent(agxData::Buffer* buffer);
72  void triggerUpdateEvent(agxData::Buffer* buffer, agx::Index index);
73  void triggerUpdateEvent(agxData::Buffer* buffer, agx::IndexRange range);
74  void triggerUpdateEvent(agxData::Buffer* buffer, agxData::Array< agx::Index > indexSet);
75 
76 private:
77  EventListenerPtrVector m_listeners;
78  agx::Thread *m_activeThread;
79  agx::UInt32 m_iterationIndex;
80 };
81 
82 class AGXCORE_EXPORT DestroyEvent : public agx::Object::Event
83 {
84 public:
85  DestroyEvent(agxData::Buffer* buffer);
86 
87  agxData::Buffer* getBuffer();
88 
89 protected:
90  virtual ~DestroyEvent();
91 
92 private:
93  agxData::Buffer* m_buffer;
94 };
95 
96 class AGXCORE_EXPORT ResizeEvent : public agx::Object::Event
97 {
98 public:
99  ResizeEvent(agxData::Buffer* buffer, agx::Index size, agx::Index oldSize);
100 
101  agxData::Buffer* getBuffer();
102  agx::Index getSize();
103  agx::Index getOldSize();
104 
105 protected:
106  virtual ~ResizeEvent();
107 
108 private:
109  agxData::Buffer* m_buffer;
111  agx::Index m_oldSize;
112 };
113 
114 class AGXCORE_EXPORT UpdateEvent : public agx::Object::Event
115 {
116 public:
117  UpdateEvent(agxData::Buffer* buffer);
118 
119  agxData::Buffer* getBuffer();
120 
121 protected:
122  virtual ~UpdateEvent();
123 
124 private:
125  agxData::Buffer* m_buffer;
126 };
127 
128 class AGXCORE_EXPORT UpdateEvent2 : public agx::Object::Event
129 {
130 public:
131  UpdateEvent2(agxData::Buffer* buffer, agx::Index index);
132 
133  agxData::Buffer* getBuffer();
134  agx::Index getIndex();
135 
136 protected:
137  virtual ~UpdateEvent2();
138 
139 private:
140  agxData::Buffer* m_buffer;
141  agx::Index m_index;
142 };
143 
144 class AGXCORE_EXPORT UpdateEvent3 : public agx::Object::Event
145 {
146 public:
147  UpdateEvent3(agxData::Buffer* buffer, agx::IndexRange range);
148 
149  agxData::Buffer* getBuffer();
150  agx::IndexRange getRange();
151 
152 protected:
153  virtual ~UpdateEvent3();
154 
155 private:
156  agxData::Buffer* m_buffer;
157  agx::IndexRange m_range;
158 };
159 
160 class AGXCORE_EXPORT UpdateEvent4 : public agx::Object::Event
161 {
162 public:
163  UpdateEvent4(agxData::Buffer* buffer, agxData::Array< agx::Index > indexSet);
164 
165  agxData::Buffer* getBuffer();
166  agxData::Array< agx::Index > getIndexSet();
167 
168 protected:
169  virtual ~UpdateEvent4();
170 
171 private:
172  agxData::Buffer* m_buffer;
173  agxData::Array< agx::Index > m_indexSet;
174 };
175 
176 
178 #endif // GENERATED_AGX_BUFFER_H_DECLARATION
agx::Thread is a representation of an OS specific implementation of a computational thread...
Definition: Thread.h:198
#define m_size
Definition: Vector.h:429
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
Abstract representation of a data buffer.
Definition: Buffer.h:55
UInt32 Index
Definition: Integer.h:52
agx::Vector< EventListener * > EventListenerPtrVector
Definition: EventListener.h:32
uint32_t UInt32
Definition: Integer.h:40
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define AGXCORE_EXPORT
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
agx::Object is a refcounted object with a name.
Definition: Object.h:58