iv::DVar< Type > Class Template Reference

#include <DVar.hpp>

Public Member Functions

 DVar (Instance *inst, DVarIdT< Type > id=DVarIdT< Type >())
 
 ~DVar ()
 
Instanceinstance ()
 
Type get ()
 
void dvar (DVarIdT< Type > id)
 
DVarIdT< Type > dvar () const
 
void on_changed (std::function< void(Type const &newval) > const &, bool call_immediately=false)
 

Public Attributes

ClientMarker cm
 

Detailed Description

template<class Type>
class iv::DVar< Type >

Used to access DVar value. To be notified about DVar changes, use DVarListener. TODO

  • if on_changed is enabled, then allow value caching
  • we need to modify DVarSystem so that he gives us value in the callback (void* reinterpret castable to the type - if it is known); posibly send type_index with it too
  • possible give this caching to DVarProperty

Definition at line 17 of file DVar.hpp.

Constructor & Destructor Documentation

◆ DVar()

template<class Type >
iv::DVar< Type >::DVar ( Instance inst,
DVarIdT< Type >  id = DVarIdT< Type >() 
)

Definition at line 5 of file DVar.inl.

◆ ~DVar()

template<class Type >
iv::DVar< Type >::~DVar

Definition at line 14 of file DVar.inl.

Member Function Documentation

◆ instance()

template<class Type >
Instance * iv::DVar< Type >::instance

Definition at line 21 of file DVar.inl.

◆ get()

template<class Type >
Type iv::DVar< Type >::get

Definition at line 63 of file DVar.inl.

◆ dvar() [1/2]

template<class Type >
void iv::DVar< Type >::dvar ( DVarIdT< Type >  id)

Definition at line 27 of file DVar.inl.

◆ dvar() [2/2]

template<class Type >
DVarIdT< Type > iv::DVar< Type >::dvar

Definition at line 45 of file DVar.inl.

◆ on_changed()

template<class Type >
void iv::DVar< Type >::on_changed ( std::function< void(Type const &newval) > const &  fun,
bool  call_immediately = false 
)

Definition at line 75 of file DVar.inl.

Member Data Documentation

◆ cm

template<class Type >
ClientMarker iv::DVar< Type >::cm

Definition at line 20 of file DVar.hpp.


The documentation for this class was generated from the following files: