ModelSimpleReference

ModelSimpleReference — a very simple implementation of ModelReference

Description

ModelSimpleReference is a ModelReference implementation. It stores a ModelObject as the value of the reference. model_simple_reference_set() can be used to change the value of the reference, and when the value is changed, the "changed" signal is emitted.

The core API of ModelSimpleReference consists of model_simple_reference_new() and model_simple_reference_set(). Additionally, there are helper functions to set and construct from one of the basic value types without requiring the manual construction of a corresponding ModelObject instance.

Details

ModelSimpleReference

typedef struct _ModelSimpleReference ModelSimpleReference;

This is an opaque structure; it may not be accessed directly.


model_simple_reference_new ()

ModelSimpleReference * model_simple_reference_new       (ModelObject *value);

Creates a ModelSimpleReference, using value as the initial value.

value :

a ModelObject to use as the initial value, or NULL

returns :

a new ModelSimpleReference

model_simple_reference_set ()

void                model_simple_reference_set          (ModelSimpleReference *simple,
                                                         ModelObject *value);

Changes the value held by simple to value and emits the "changed" signal.

simple :

a ModelSimpleReference

value :

the ModelObject to use as the new value, or NULL

model_simple_reference_new_string ()

ModelSimpleReference * model_simple_reference_new_string
                                                        (const gchar *value);

Creates a new ModelSimpleReference holding a string.

This is a convenience wrapper around model_simple_reference_new() and model_string_new().

value :

a string

returns :

a new ModelSimpleReference

model_simple_reference_new_integer ()

ModelSimpleReference * model_simple_reference_new_integer
                                                        (gint value);

Creates a new ModelSimpleReference holding an integer.

This is a convenience wrapper around model_simple_reference_new() and model_integer_new().

value :

an integer

returns :

a new ModelSimpleReference

model_simple_reference_new_float ()

ModelSimpleReference * model_simple_reference_new_float (gdouble value);

Creates a new ModelSimpleReference holding a floating point value.

This is a convenience wrapper around model_simple_reference_new() and model_float_new().

value :

a double precision floating point value

returns :

a new ModelSimpleReference

model_simple_reference_new_boolean ()

ModelSimpleReference * model_simple_reference_new_boolean
                                                        (gboolean value);

Creates a new ModelSimpleReference holding a boolean value.

This is a convenience wrapper around model_simple_reference_new() and model_boolean_new().

value :

a boolean value

returns :

a new ModelSimpleReference

model_simple_reference_set_string ()

void                model_simple_reference_set_string   (ModelSimpleReference *simple,
                                                         const gchar *value);

Updates the value of simple to the given string.

This is a convenience wrapper around model_simple_reference_set() and model_string_new().

simple :

a ModelSimpleReference

value :

a string

model_simple_reference_set_integer ()

void                model_simple_reference_set_integer  (ModelSimpleReference *simple,
                                                         gint value);

Updates the value of simple to the given integer.

This is a convenience wrapper around model_simple_reference_set() and model_integer_new().

simple :

a ModelSimpleReference

value :

an integer

model_simple_reference_set_float ()

void                model_simple_reference_set_float    (ModelSimpleReference *simple,
                                                         gdouble value);

Updates the value of simple to the given floating point value.

This is a convenience wrapper around model_simple_reference_set() and model_float_new().

simple :

a ModelSimpleReference

value :

a double precision floating point value

model_simple_reference_set_boolean ()

void                model_simple_reference_set_boolean  (ModelSimpleReference *simple,
                                                         gboolean value);

Updates the value of simple to the given boolean value.

This is a convenience wrapper around model_simple_reference_set() and model_boolean_new().

simple :

a ModelSimpleReference

value :

a boolean value