![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <cpg-network/cpg-property.h> enum CpgPropertyHint; CpgProperty; CpgProperty * cpg_property_new (const gchar *name, const gchar *expression, gboolean integrated, CpgObject *object); const gchar * cpg_property_get_name (CpgProperty *property); gboolean cpg_property_get_integrated (CpgProperty *property); void cpg_property_set_integrated (CpgProperty *property, gboolean integrated); CpgPropertyHint cpg_property_get_hint (CpgProperty *property); void cpg_property_set_hint (CpgProperty *property, CpgPropertyHint hint); void cpg_property_add_hint (CpgProperty *property, CpgPropertyHint hint); void cpg_property_remove_hint (CpgProperty *property, CpgPropertyHint hint); void cpg_property_reset_cache (CpgProperty *property); gdouble cpg_property_get_value (CpgProperty *property); CpgExpression * cpg_property_get_value_expression (CpgProperty *property); void cpg_property_set_value (CpgProperty *property, gdouble value); void cpg_property_set_value_expression (CpgProperty *property, const gchar *expression); gboolean cpg_property_equal (CpgProperty *property, CpgProperty *other); guint cpg_property_get_used (CpgProperty *property);
A CpgProperty is a container for a specific variable in an object. It consists of a name and a mathematical expression describing its contents.
typedef enum { CPG_PROPERTY_HINT_NONE = 0, CPG_PROPERTY_HINT_IN = 1 << 0, CPG_PROPERTY_HINT_OUT = 1 << 1, CPG_PROPERTY_HINT_ONCE = 1 << 2 } CpgPropertyHint;
CpgProperty * cpg_property_new (const gchar *name, const gchar *expression, gboolean integrated, CpgObject *object);
Create a new property object. Property objects are assigned to CpgObject objects and are of little use on their own. The provided expression will not be parsed initially.
|
the property name |
|
the value expression |
|
whether this property should be integated during the simulation |
|
the CpgObject to which the property belongs |
Returns : |
the new CpgProperty |
const gchar * cpg_property_get_name (CpgProperty *property);
Get the property name
|
a CpgProperty |
Returns : |
the property name |
gboolean cpg_property_get_integrated (CpgProperty *property);
Get whether the property should be integrated during evaluation or not
|
a CpgProperty |
Returns : |
TRUE if the property will be integrated, FALSE otherwise
|
void cpg_property_set_integrated (CpgProperty *property, gboolean integrated);
Set whether the property should be integrated during evaluation or not
|
a CpgProperty |
|
integrate the property |
CpgPropertyHint cpg_property_get_hint (CpgProperty *property);
The property hint. The hint contains information on the type of property ( such as in, or out).
|
A CpgProperty |
Returns : |
A CpgPropertyHint |
void cpg_property_set_hint (CpgProperty *property, CpgPropertyHint hint);
Set the property hint.
|
A CpgProperty |
|
A CpgPropertyHint |
void cpg_property_add_hint (CpgProperty *property, CpgPropertyHint hint);
Add a hint flag to the property hints.
|
A CpgProperty |
|
A CpgPropertyHint |
void cpg_property_remove_hint (CpgProperty *property, CpgPropertyHint hint);
Remove a hint flag from the property hints.
|
A CpgProperty |
|
A CpgPropertyHint |
void cpg_property_reset_cache (CpgProperty *property);
Reset the cached value of the property expression
|
a CpgProperty |
gdouble cpg_property_get_value (CpgProperty *property);
Get the numerical value of the current value of the property
|
the CpgProperty |
Returns : |
the numerical value of the property's current value |
CpgExpression * cpg_property_get_value_expression (CpgProperty *property);
Get the property value expression
|
a CpgProperty |
Returns : |
a CpgExpression. The expression is owned by the property and should not be freed |
void cpg_property_set_value (CpgProperty *property, gdouble value);
Change the value to a specific number. To set the value to any expression, use cpg_object_set_value.
|
the CpgProperty |
|
the new value |
void cpg_property_set_value_expression (CpgProperty *property, const gchar *expression);
Set the property value from an expression. This will mark the associated CpgObject as tainted so the expression will be recompiled accordingly.
|
a CpgProperty |
|
the expression |
gboolean cpg_property_equal (CpgProperty *property, CpgProperty *other);
Compare two properties for equal values/expressions
|
a CpgProperty |
|
a CpgProperty |
Returns : |
TRUE if the properties are equal, FALSE otherwise
|
guint cpg_property_get_used (CpgProperty *property);
Get how many times the property is used currently.
|
A CpgProperty |
Returns : |
The number of times the property is used |