class ov::op::util::VariableContext

Overview

VariableContext stores and manages a evaluation context for Variables. More…

#include <variable_context.hpp>

class VariableContext
{
public:
    // construction

    VariableContext();
    VariableContext(const VariableMap& variable_values);

    // methods

    void reset_variable_context() const;
    void set_variable_values(const VariableMap& variable_values);

    void set_variable_value(
        const Variable::Ptr& variable,
        const VariableValue::Ptr& variable_value
        );

    void remove_variable_value(const Variable::Ptr& variable);
    const VariableMap& get_variable_values() const;
    VariableValue::Ptr get_variable_value(const Variable::Ptr& variable) const;
};

Detailed Documentation

VariableContext stores and manages a evaluation context for Variables.

Construction

VariableContext()

Constructs an uninitialized VariableContext.

VariableContext(const VariableMap& variable_values)

Constructor for VariableContext.

Parameters:

variable_values

The values associated with a particular Variables.

Methods

void reset_variable_context() const

Sets the reset flags for all stored Variables to true.

void set_variable_values(const VariableMap& variable_values)

Sets the new values for Variables.

Parameters:

variable_values

The new values associated with a particular Variable.

void set_variable_value(
    const Variable::Ptr& variable,
    const VariableValue::Ptr& variable_value
    )

Changes/sets the values for Variable.

Parameters:

variable

New or stored Variable.

variable_value

The values associated with the variable.

void remove_variable_value(const Variable::Ptr& variable)

Removes context for a particular Variable.

Parameters:

variable

The variable for which the context will be cleared.

const VariableMap& get_variable_values() const

Returns the current values for Variables.

VariableValue::Ptr get_variable_value(const Variable::Ptr& variable) const

Returns the value for specified Variable.