Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Structures | Namespaces | Macros | Typedefs | Functions
DataModel.h File Reference
#include <set>
#include <memory>
#include <QObject>
#include "Locked.h"
Include dependency graph for DataModel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  omni::ui::mixin::detail::PointerType< T, SHARED >
 Pointer type handler. More...
 
struct  omni::ui::mixin::detail::PointerType< T, true >
 Use std::shared_ptr when shared is true. More...
 
struct  omni::ui::mixin::detail::PointerType< T, false >
 Use raw pointer (T*) when shared is false. More...
 
class  omni::ui::mixin::DataModelInterface
 Data model interface. More...
 
class  omni::ui::mixin::DataModel< DATAMODEL, SHARED >
 Holds a specific data model with frontend update mechanism. More...
 

Namespaces

 omni
 Header to document namespaces.
 
 omni::ui
 Namespace for user interface elements and widgets.
 
 omni::ui::mixin
 Namespace for helper classes and mixins.
 
 omni::ui::mixin::detail
 

Macros

#define OMNI_UI_DATAMODEL(MODEL, SHARED)
 This macro needs to be inserted for every widget that uses DataModel. More...
 
#define OMNI_UI_SHARED_DATAMODEL(MODEL)   OMNI_UI_DATAMODEL(MODEL, true)
 
#define OMNI_UI_UNSHARED_DATAMODEL(MODEL)   OMNI_UI_DATAMODEL(MODEL, false)
 

Typedefs

template<typename T >
using omni::ui::mixin::SharedDataModel = DataModel< T, true >
 Template alias for shared data model. More...
 
template<typename T >
using omni::ui::mixin::UnsharedDataModel = DataModel< T, false >
 Template alias for unshared data model. More...
 

Functions

template<typename WIDGET , typename DATAMODEL , typename... ARGS>
static WIDGET * omni::ui::mixin::makeWidget (DATAMODEL *_dataModel, ARGS &&..._args)
 Instantiate a new widget and set data model Uses raw pointer (unshared data model) More...
 
template<typename WIDGET , typename DATAMODEL , typename... ARGS>
static WIDGET * omni::ui::mixin::makeWidget (std::shared_ptr< DATAMODEL >_dataModel, ARGS &&..._args)
 Instantiate a new widget and set data model Uses shared pointer (shared data model) More...
 

Macro Definition Documentation

#define OMNI_UI_DATAMODEL (   MODEL,
  SHARED 
)
Value:
public: \
typedef omni::ui::mixin::DataModel<MODEL, SHARED>mixin_data_model_type; \
inline void updateDataModel() { \
mixin_data_model_type::updateDataModel(); \
} \
inline void updateFrontend() { \
this->locked([&]() { \
mixin_data_model_type::updateFrontend(); \
update(); \
}); \
} \
private: \
void emitDataModelChangedSignal() { \
emit dataModelChanged(); \
} \
public:
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87

This macro needs to be inserted for every widget that uses DataModel.

#define OMNI_UI_SHARED_DATAMODEL (   MODEL)    OMNI_UI_DATAMODEL(MODEL, true)
#define OMNI_UI_UNSHARED_DATAMODEL (   MODEL)    OMNI_UI_DATAMODEL(MODEL, false)