gramods
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
gramods::gmCore::Updateable Class Referenceabstract

The Updateable class defines an interface for objects that may be updated, for example each execution frame. More...

#include <Updateable.hh>

Inheritance diagram for gramods::gmCore::Updateable:
Inheritance graph
[legend]

Classes

struct  Impl
 

Public Types

typedef std::chrono::steady_clock clock
 

Public Member Functions

 Updateable (int priority=0)
 Configures the Updateable properties to the specified priority. More...
 
virtual void update (clock::time_point t, size_t frame)=0
 Called by updateAll to make the object up-to-date. More...
 

Static Public Member Functions

static void updateAll (clock::time_point t=clock::now(), std::optional< size_t > frame=std::nullopt)
 Updates all currently instanciated updateable objects. More...
 

Detailed Description

The Updateable class defines an interface for objects that may be updated, for example each execution frame.

This may be an animator or a network connection.

Constructor & Destructor Documentation

◆ Updateable()

gramods::gmCore::Updateable::Updateable ( int  priority = 0)

Configures the Updateable properties to the specified priority.

Upon call to updateAll all instances of Updateable will be called in turn based on their priority. Highest priority will be called first and lowest last. Instances with the same priority will be called in the order of instantiation.

Member Function Documentation

◆ update()

virtual void gramods::gmCore::Updateable::update ( clock::time_point  t,
size_t  frame 
)
pure virtual

◆ updateAll()

void gramods::gmCore::Updateable::updateAll ( clock::time_point  t = clock::now(),
std::optional< size_t >  frame = std::nullopt 
)
static

Updates all currently instanciated updateable objects.


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