![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define CPG_OPERATOR_CONST (obj) struct CpgOperator; struct CpgOperatorClass; void cpg_operator_initialize (CpgOperator *op
,GSList const *expressions
); void cpg_operator_execute (CpgOperator *op
,CpgStack *stack
); void cpg_operator_reset_cache (CpgOperator *op
); void cpg_operator_reset_variadic (CpgOperator *op
); gchar const * cpg_operator_get_name (CpgOperator *op
); gchar const * cpg_operator_get_class_name (CpgOperatorClass *op
); gboolean cpg_operator_validate_num_arguments (CpgOperatorClass *op
,gint num
); GSList const * cpg_operator_get_expressions (CpgOperator *op
); gboolean cpg_operator_equal (CpgOperator *op
,CpgOperator *other
); void cpg_operator_step (CpgOperator *op
,struct _CpgIntegrator *integrator
,gdouble t
,gdouble timestep
); void cpg_operator_step_prepare (CpgOperator *op
,struct _CpgIntegrator *integrator
,gdouble t
,gdouble timestep
); void cpg_operator_step_evaluate (CpgOperator *op
,struct _CpgIntegrator *integrator
,gdouble t
,gdouble timestep
); void cpg_operator_reset (CpgOperator *op
); CpgOperator * cpg_operator_copy (CpgOperator *op
); CpgOperatorPrivate; CpgOperatorClassPrivate;
#define CPG_OPERATOR_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CPG_TYPE_OPERATOR, CpgOperator const))
struct CpgOperatorClass { void (*execute) (CpgOperator *op, CpgStack *stack); void (*initialize) (CpgOperator *op, GSList const *expressions); gchar *(*get_name) (); gboolean (*validate_num_arguments) (gint num); void (*reset_cache) (CpgOperator *op); void (*reset_variadic) (CpgOperator *op); void (*reset) (CpgOperator *op); void (*step) (CpgOperator *op, struct _CpgIntegrator *integrator, gdouble t, gdouble timestep); void (*step_prepare) (CpgOperator *op, struct _CpgIntegrator *integrator, gdouble t, gdouble timestep); void (*step_evaluate) (CpgOperator *op, struct _CpgIntegrator *integrator, gdouble t, gdouble timestep); gboolean (*equal) (CpgOperator *op, CpgOperator *other); };
void cpg_operator_initialize (CpgOperator *op
,GSList const *expressions
);
void cpg_operator_execute (CpgOperator *op
,CpgStack *stack
);
Execute the operator. This function should always be overridden by operator implementations and should always push exactly one number on the stack.
|
A CpgOperator |
|
A CpgStack |
void cpg_operator_reset_cache (CpgOperator *op
);
Reset the cache of the operator instance.
|
A CpgOperator |
void cpg_operator_reset_variadic (CpgOperator *op
);
Reset the variadic cache of the operator instance.
|
A CpgOperator |
gchar const * cpg_operator_get_name (CpgOperator *op
);
Get the operator name. This is the identifier that is used in expressions, and thus can only contain valid identifier characters.
|
A CpgOperator |
Returns : |
a newly allocated string with the operator name, use g_free to free the value when it's no longer needed. |
gchar const * cpg_operator_get_class_name (CpgOperatorClass *op
);
Get the operator name. This is the identifier that is used in expressions, and thus can only contain valid identifier characters.
|
A CpgOperatorClass |
Returns : |
a newly allocated string with the operator name, use g_free to free the value when it's no longer needed. |
gboolean cpg_operator_validate_num_arguments (CpgOperatorClass *op
,gint num
);
Get the number of arguments that the operators expects.
|
A CpgOperator |
Returns : |
the number of arguments or -1 if the operator accepts a variable number of arguments. |
GSList const * cpg_operator_get_expressions (CpgOperator *op
);
Get the expressions that the operator uses.
|
A CpgOperator |
Returns : |
a list of CpgExpression. [element-type CpgExpression][transfer none] |
void cpg_operator_step (CpgOperator *op
,struct _CpgIntegrator *integrator
,gdouble t
,gdouble timestep
);
void cpg_operator_step_prepare (CpgOperator *op
,struct _CpgIntegrator *integrator
,gdouble t
,gdouble timestep
);
void cpg_operator_step_evaluate (CpgOperator *op
,struct _CpgIntegrator *integrator
,gdouble t
,gdouble timestep
);
CpgOperator * cpg_operator_copy (CpgOperator *op
);
Copy an operator.
|
A CpgOperator |
Returns : |
A CpgOperator. [transfer full] |