libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
objectbase.h File Reference
#include <tuple>
#include <functional>
#include <promeki/core/namespace.h>
#include <promeki/core/list.h>
#include <promeki/core/map.h>
#include <promeki/core/mutex.h>
#include <promeki/core/util.h>
#include <promeki/core/logger.h>
#include <promeki/core/signal.h>
#include <promeki/core/slot.h>
#include <promeki/core/eventloop.h>
Include dependency graph for objectbase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ObjectBasePtr
 Object that holds a pointer to an ObjectBase (or derived) object. This class will register itself with the given ObjectBase object. When the registered ObjectBase object is destroyed, it will null the internal pointer. You can use this object to ensure you don't have dangling pointers to ObjectBase objects. More...
 
class  ObjectBase
 Base object for promeki. More...
 
class  ObjectBase::MetaInfo
 Captures all the metadata about this object. More...
 
class  ObjectBase::SignalMeta
 Metadata entry describing a signal on an ObjectBase-derived class. More...
 
class  ObjectBase::SlotMeta
 Metadata entry describing a slot on an ObjectBase-derived class. More...
 

Macros

#define PROMEKI_OBJECT(ObjectName, ParentObjectName)
 
#define PROMEKI_SIGNAL(SIGNALNAME, ...)
 
#define PROMEKI_SLOT(SLOTNAME, ...)
 

Typedefs

using ObjectBaseList = List< ObjectBase * >
 

Detailed Description

See LICENSE file in the project root folder for license information.

Macro Definition Documentation

◆ PROMEKI_OBJECT

#define PROMEKI_OBJECT (   ObjectName,
  ParentObjectName 
)
Value:
public: \
static const MetaInfo &metaInfo() { \
static const MetaInfo __metaInfo( \
typeid(ObjectName).name(), \
&ParentObjectName::metaInfo() \
); \
return __metaInfo; \
}
Dynamic array container wrapping std::vector.
Definition list.h:40

◆ PROMEKI_SIGNAL

#define PROMEKI_SIGNAL (   SIGNALNAME,
  ... 
)
Value:
static constexpr const char *SIGNALNAME##SignalName = PROMEKI_STRINGIFY(SIGNALNAME) "(" PROMEKI_STRINGIFY_ARGS(__VA_ARGS__) ")"; \
static inline SignalMeta SIGNALNAME##SignalMeta = SignalMeta(metaInfo(), SIGNALNAME##SignalName); \
Type-safe signal/slot mechanism for decoupled event notification.
Definition signal.h:27

◆ PROMEKI_SLOT

#define PROMEKI_SLOT (   SLOTNAME,
  ... 
)
Value:
static constexpr const char *SLOTNAME##SlotName = PROMEKI_STRINGIFY(SLOTNAME) "(" PROMEKI_STRINGIFY_ARGS(__VA_ARGS__) ")"; \
static inline SlotMeta SLOTNAME##SlotMeta = SlotMeta(metaInfo(), SLOTNAME##SlotName); \
[this](auto&&... args) { this->SLOTNAME(std::forward<decltype(args)>(args)...); }, \
this, SLOTNAME##SlotName \
); \
int SLOTNAME##SlotID = registerSlot(&SLOTNAME##Slot);
Type-safe callback slot that wraps a callable with optional ownership tracking.
Definition slot.h:29