gtkmm 4.22.0
Static Public Member Functions | List of all members
Gtk::TryExpression< T > Class Template Referencefinal

A Gtk::Expression that tries to evaluate each of its expressions until it succeeds. More...

#include <gtkmm/expression.h>

Inheritance diagram for Gtk::TryExpression< T >:
Inheritance graph
[legend]

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
static Glib::RefPtr< TryExpressioncreate (const std::vector< Glib::RefPtr< Expression< T > > > &expressions)
 Creates an expression with a vector of expressions.
 

Additional Inherited Members

- Public Types inherited from Gtk::Expression< T >
using ValueType = T
 
- Public Types inherited from Gtk::ExpressionBase
using SlotNotify = sigc::slot< void()>
 For instance: void on_notify();.
 
- Public Member Functions inherited from Gtk::Expression< T >
std::optional< T > evaluate (const Glib::RefPtr< Glib::ObjectBase > &this_)
 Evaluates the given expression and on success returns the result.
 
Glib::RefPtr< ExpressionWatch< T > > watch (const Glib::RefPtr< Glib::ObjectBase > &this_, const SlotNotify & notify)
 Installs a watch for the expression that calls the notify function whenever the evaluation of the expression may have changed.
 
template<class T2 >
Glib::RefPtr< ExpressionWatch< T > > bind (const Glib::PropertyProxy< T2 > &property, const Glib::RefPtr< Glib::ObjectBase > &this_=nullptr)
 Bind a target's property to the expression.
 
template<class T2 >
Glib::RefPtr< ExpressionWatch< T > > bind (const Glib::PropertyProxy_WriteOnly< T2 > &property, const Glib::RefPtr< Glib::ObjectBase > &this_=nullptr)
 Bind a target's property to the expression.
 
- Public Member Functions inherited from Gtk::ExpressionBase
void reference () const
 Increment the reference count for this object.
 
void unreference () const
 Decrement the reference count for this object.
 
GtkExpressiongobj ()
 Provides access to the underlying C instance.
 
const GtkExpressiongobj () const
 Provides access to the underlying C instance.
 
GtkExpressiongobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
 ExpressionBase ()=delete
 
 ExpressionBase (const ExpressionBase &)=delete
 
ExpressionBaseoperator= (const ExpressionBase &)=delete
 
GType get_value_type () const
 Gets the GType that this expression evaluates to.
 
bool is_static () const
 Checks if the expression is static.
 
- Protected Member Functions inherited from Gtk::ExpressionBase
void operator delete (void *, std::size_t)
 

Detailed Description

template<class T>
class Gtk::TryExpression< T >

A Gtk::Expression that tries to evaluate each of its expressions until it succeeds.

If all expressions fail to evaluate, the Gtk::TryExpression's evaluation fails as well.

Since gtkmm 4.22:

Member Function Documentation

◆ create()

template <class T >
static Glib::RefPtr< TryExpression > Gtk::TryExpression< T >::create ( const std::vector< Glib::RefPtr< Expression< T > > > &  expressions)
static

Creates an expression with a vector of expressions.

When evaluated, the Gtk::TryExpression tries to evaluate each of its expressions until it succeeds. If all expressions fail to evaluate, the Gtk::TryExpression's evaluation fails as well.

Parameters
expressionsA vector of Gtk::Expressions. The value type of the expressions in the vector must match.
Returns
A new Gtk::TryExpression. If expressions is an empty vector, or contains only empty RefPtrs, or the value types don't match, an empty RefPtr is returned.
Since gtkmm 4.22:

◆ get_type()

template <class T >
static GType Gtk::TryExpression< T >::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

Since gtkmm 4.22: