Rumba C++ SDK
maquina::ConditionalEvalContext Class Reference

#include <ConditionalEvalContext.h>

Public Member Functions

bool is_exact () const
 Informs the callback if the current plug evaluation is done in exact mode (True) or interactive mode (False). More...
 
std::optional< Valuevalue (int dep) const
 Return the trivial value of the plug's n-th dependency, if available. More...
 

Detailed Description

This class provides a context to the PlugDescriptor evaluate callback.

Member Function Documentation

◆ is_exact()

bool maquina::ConditionalEvalContext::is_exact ( ) const
inline

Informs the callback if the current plug evaluation is done in exact mode (True) or interactive mode (False).

The callback can use that information to decide to not evaluate a dependency (like a temporal one) during the user interaction.

◆ value()

std::optional<Value> maquina::ConditionalEvalContext::value ( int  dep) const

Return the trivial value of the plug's n-th dependency, if available.

The callback can use that method to decide to evaluate the plug regarding the (trivial) values of its dependences. A trivial value is available when the dependency or its input plugs have a constant, valid value in cache. If the value is not constant or if an evaluation is required during an invalidation to get the value, the value is not trivial and the method returns nothing.


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