AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
EntityStorageEvent.Declaration.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or
9having been advised so by Algoryx Simulation AB for a time limited evaluation,
10or having purchased a valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17//-----------------------------------------------
18// AUTOMATICALLY GENERATED EVENT, DO NOT EDIT!
19//-----------------------------------------------
20
21#ifndef GENERATED_AGX_ENTITYSTORAGE_H_DECLARATION
22#define GENERATED_AGX_ENTITYSTORAGE_H_DECLARATION
23
24#include <agx/macros.h>
25
27class EventDispatch;
28
29class AGXCORE_EXPORT EventListener
30{
31public:
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::EntityStorage* storage);
41 virtual void createInstanceCallback(agxData::EntityStorage* storage, agxData::EntityPtr instance);
42 virtual void createInstancesCallback(agxData::EntityStorage* storage, agxData::EntityRange range);
43 virtual void createInstancesCallback(agxData::EntityStorage* storage, agxData::Array< agxData::EntityPtr > instances);
44 virtual void destroyInstanceCallback(agxData::EntityStorage* storage, agxData::EntityPtr instance);
45 virtual void destroyInstancesCallback(agxData::EntityStorage* storage, agxData::EntityRange range);
46 virtual void destroyInstancesCallback(agxData::EntityStorage* storage, agxData::Array< agxData::EntityPtr > instances);
47 virtual void permuteCallback(agxData::EntityStorage* storage, agxData::Array< agx::Index > permutation);
48
49private:
50 friend class EventDispatch;
51private:
52 agx::Object* m_owner;
53 agx::UInt32 m_numRegistered;
54};
55
56class AGXCORE_EXPORT EventDispatch
57{
58public:
59 EventDispatch();
60 ~EventDispatch();
61
62public:
63 void addListener(EventListener* listener);
64 void removeListener(EventListener* listener);
65 bool hasListener(EventListener* listener) const;
66
68 const EventListenerPtrVector& getListeners() const;
69
70public:
71 void triggerDestroyEvent(agxData::EntityStorage* storage);
72 void triggerCreateInstanceEvent(agxData::EntityStorage* storage, agxData::EntityPtr instance);
73 void triggerCreateInstancesEvent(agxData::EntityStorage* storage, agxData::EntityRange range);
74 void triggerCreateInstancesEvent(agxData::EntityStorage* storage, agxData::Array< agxData::EntityPtr > instances);
75 void triggerDestroyInstanceEvent(agxData::EntityStorage* storage, agxData::EntityPtr instance);
76 void triggerDestroyInstancesEvent(agxData::EntityStorage* storage, agxData::EntityRange range);
77 void triggerDestroyInstancesEvent(agxData::EntityStorage* storage, agxData::Array< agxData::EntityPtr > instances);
78 void triggerPermuteEvent(agxData::EntityStorage* storage, agxData::Array< agx::Index > permutation);
79
80private:
81 EventListenerPtrVector m_listeners;
82 agx::Thread *m_activeThread;
83 agx::UInt32 m_iterationIndex;
84};
85
86class AGXCORE_EXPORT DestroyEvent : public agx::Object::Event
87{
88public:
89 DestroyEvent(agxData::EntityStorage* storage);
90
92
93protected:
94 virtual ~DestroyEvent();
95
96private:
97 agxData::EntityStorage* m_storage;
98};
99
100class AGXCORE_EXPORT CreateInstanceEvent : public agx::Object::Event
101{
102public:
103 CreateInstanceEvent(agxData::EntityStorage* storage, agxData::EntityPtr instance);
104
106 agxData::EntityPtr getInstance();
107
108protected:
109 virtual ~CreateInstanceEvent();
110
111private:
112 agxData::EntityStorage* m_storage;
113 agxData::EntityPtr m_instance;
114};
115
116class AGXCORE_EXPORT CreateInstancesEvent : public agx::Object::Event
117{
118public:
119 CreateInstancesEvent(agxData::EntityStorage* storage, agxData::EntityRange range);
120
122 agxData::EntityRange getRange();
123
124protected:
125 virtual ~CreateInstancesEvent();
126
127private:
128 agxData::EntityStorage* m_storage;
129 agxData::EntityRange m_range;
130};
131
132class AGXCORE_EXPORT CreateInstancesEvent2 : public agx::Object::Event
133{
134public:
135 CreateInstancesEvent2(agxData::EntityStorage* storage, agxData::Array< agxData::EntityPtr > instances);
136
139
140protected:
141 virtual ~CreateInstancesEvent2();
142
143private:
144 agxData::EntityStorage* m_storage;
146};
147
148class AGXCORE_EXPORT DestroyInstanceEvent : public agx::Object::Event
149{
150public:
151 DestroyInstanceEvent(agxData::EntityStorage* storage, agxData::EntityPtr instance);
152
154 agxData::EntityPtr getInstance();
155
156protected:
157 virtual ~DestroyInstanceEvent();
158
159private:
160 agxData::EntityStorage* m_storage;
161 agxData::EntityPtr m_instance;
162};
163
164class AGXCORE_EXPORT DestroyInstancesEvent : public agx::Object::Event
165{
166public:
167 DestroyInstancesEvent(agxData::EntityStorage* storage, agxData::EntityRange range);
168
170 agxData::EntityRange getRange();
171
172protected:
173 virtual ~DestroyInstancesEvent();
174
175private:
176 agxData::EntityStorage* m_storage;
177 agxData::EntityRange m_range;
178};
179
180class AGXCORE_EXPORT DestroyInstancesEvent2 : public agx::Object::Event
181{
182public:
183 DestroyInstancesEvent2(agxData::EntityStorage* storage, agxData::Array< agxData::EntityPtr > instances);
184
187
188protected:
189 virtual ~DestroyInstancesEvent2();
190
191private:
192 agxData::EntityStorage* m_storage;
194};
195
196class AGXCORE_EXPORT PermuteEvent : public agx::Object::Event
197{
198public:
199 PermuteEvent(agxData::EntityStorage* storage, agxData::Array< agx::Index > permutation);
200
202 agxData::Array< agx::Index > getPermutation();
203
204protected:
205 virtual ~PermuteEvent();
206
207private:
208 agxData::EntityStorage* m_storage;
209 agxData::Array< agx::Index > m_permutation;
210};
211
212
214#endif // GENERATED_AGX_ENTITYSTORAGE_H_DECLARATION
#define AGXCORE_EXPORT
Type-specific Array used for fast access into the data held by a Buffer.
Definition: Array.h:107
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:52
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:73
agx::Object is a refcounted object with a name.
Definition: Object.h:59
agx::Thread is a representation of an OS specific implementation of a computational thread.
Definition: Thread.h:199
Vector containing 'raw' data.
Definition: agx/Vector.h:246
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
agx::Vector< EventListener * > EventListenerPtrVector
Definition: EventListener.h:31
AGXTERRAIN_EXPORT TimingStorage & getStorage()
uint32_t UInt32
Definition: Integer.h:32