AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
ObjectEvent.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_OBJECT_H_DECLARATION
22#define GENERATED_AGX_OBJECT_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(agx::Object* object);
41
42private:
43 friend class EventDispatch;
44private:
45 agx::Object* m_owner;
46 agx::UInt32 m_numRegistered;
47};
48
49class AGXCORE_EXPORT EventDispatch
50{
51public:
52 EventDispatch();
53 ~EventDispatch();
54
55public:
56 void addListener(EventListener* listener);
57 void removeListener(EventListener* listener);
58 bool hasListener(EventListener* listener) const;
59
61 const EventListenerPtrVector& getListeners() const;
62
63public:
64 void triggerDestroyEvent(agx::Object* object);
65
66private:
67 EventListenerPtrVector m_listeners;
68 agx::Thread *m_activeThread;
69 agx::UInt32 m_iterationIndex;
70};
71
72class AGXCORE_EXPORT DestroyEvent : public agx::Object::Event
73{
74public:
75 DestroyEvent(agx::Object* object);
76
77 agx::Object* getObject();
78
79protected:
80 virtual ~DestroyEvent();
81
82private:
83 agx::Object* m_object;
84};
85
86
88#endif // GENERATED_AGX_OBJECT_H_DECLARATION
#define AGXCORE_EXPORT
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
uint32_t UInt32
Definition: Integer.h:32