LuciadCPillar 2023.1.02
luciad::IInvalidationCallback Class Referenceabstract

This is a callback class that is called when something is invalidated. More...

#include <luciad/utils/IInvalidationCallback.h>

Public Member Functions

virtual ~IInvalidationCallback ()=default
 
virtual void onInvalidate ()=0
 Called by the object on which this callback was set when the object is invalidated. More...
 

Static Public Member Functions

static std::shared_ptr< IInvalidationCallbackcreate (std::function< void()> function)
 Creates a default IInvalidationCallback instance that delegates the IInvalidationCallback::onInvalidate to the given function. More...
 

Detailed Description

This is a callback class that is called when something is invalidated.

For example, this class is implemented (and set on the Map) when integrating a Map component with a UI framework. In that case, implementations of this class need to make sure that the UI framework will eventually call Map::Renderer::paint .

Constructor & Destructor Documentation

◆ ~IInvalidationCallback()

virtual luciad::IInvalidationCallback::~IInvalidationCallback ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IInvalidationCallback > luciad::IInvalidationCallback::create ( std::function< void()>  function)
static

Creates a default IInvalidationCallback instance that delegates the IInvalidationCallback::onInvalidate to the given function.

This is a convenience method that allows to reduce boiler plate code, and use lambdas.

Parameters
functionthe function that is called by IInvalidationCallback::onInvalidate
Returns
an IInvalidationCallback instance based on the given function.

◆ onInvalidate()

virtual void luciad::IInvalidationCallback::onInvalidate ( )
pure virtual

Called by the object on which this callback was set when the object is invalidated.