properties.c File Reference

#include <string.h>
#include "properties.h"
#include "utils/list.h"

Functions

int update_property_value_data (prop_val_t *prop_value, void *new_data)
 Update property value.
int set_property_by_name (void *entity, char *propname, void *value)
 Set new property for entity.
int set_property (void *entity, property_t *property, void *value)
 Set new property for entity.
int set_property_with_prop_val (void *entity, const prop_val_t *prop_val)
 Set property with ginen prop_val_t struct.
const prop_val_tget_property (individual_t *ind, const char *propname)
 Get property by name.
const list_t * get_property_node (individual_t *ind, const char *propname)
 Get node of properties list with given property name .
const prop_val_tget_property_with_data (individual_t *ind, const char *propname, void *data)
 Get property value with given data.
list_t * get_properties (individual_t *ind, const char *propname)
 Get all properties with given name.
int update_property (void *entity, const char *propname, void *new_data)
 Update property with given name.
int update_property_with_data (void *entity, const char *propname, const void *old_data, void *new_data)
 Update property using old value.
int unset_property_for_individual (individual_t *ind, char *propname, void *data)
 Unset property value.
const property_tget_property_type (const class_t *class, const char *propname)
 Get property struct by given name.
bool is_individual_has_property (individual_t *individual, property_t *prop)
 Checks property for individual.
bool is_prop_values_equal (prop_val_t *a, prop_val_t *b)
 Checks equality of given properties values.
bool is_prop_names_equal (prop_val_t *a, prop_val_t *b)
 Checks equality of properties names of given properties values.

Function Documentation

list_t* get_properties ( individual_t ind,
const char *  propname 
)

Get all properties with given name.

Parameters:
ind individual.
propname name of property.
Returns:
properties values list on success or NULL otherwise.

const prop_val_t* get_property ( individual_t ind,
const char *  propname 
)

Get property by name.

Parameters:
ind individual.
propname name of property.
Returns:
0 on success or not otherwise.

const list_t* get_property_node ( individual_t ind,
const char *  propname 
)

Get node of properties list with given property name .

Parameters:
ind individual.
propname name of property.
Returns:
node of list on success or NULL otherwise.

const property_t* get_property_type ( const class_t class,
const char *  propname 
)

Get property struct by given name.

Parameters:
class class.
propname name of property.
Returns:
property struct on success or NULL otherwise.

const prop_val_t* get_property_with_data ( individual_t ind,
const char *  propname,
void *  data 
)

Get property value with given data.

Parameters:
ind individual.
propname name of property.
data value of property.
Returns:
property value struct on success or NULL otherwise.

bool is_individual_has_property ( individual_t individual,
property_t prop 
)

Checks property for individual.

Parameters:
individual individual.
prop property.
Returns:
true if individual has property, otherwise false.

bool is_prop_names_equal ( prop_val_t a,
prop_val_t b 
)

Checks equality of properties names of given properties values.

Parameters:
a one property value.
b another property value.
Returns:
true if equals or false otherwise.

bool is_prop_values_equal ( prop_val_t a,
prop_val_t b 
)

Checks equality of given properties values.

Parameters:
a one property value.
b another property value.
Returns:
true if equals or false otherwise.

int set_property ( void *  entity,
property_t property,
void *  value 
)

Set new property for entity.

Set property for one individuals or for all individuals from class.

Parameters:
entity class or individual.
property property.
value value to set.
Returns:
0 on success or not otherwise.

int set_property_by_name ( void *  entity,
char *  propname,
void *  value 
)

Set new property for entity.

Set property for one individuals or for all individuals from class.

Parameters:
entity class or individual.
propname name of the property.
value value to set.
Returns:
0 on success or not otherwise.

int set_property_with_prop_val ( void *  entity,
const prop_val_t prop_val 
)

Set property with ginen prop_val_t struct.

Set property for one individuals or for all individuals from class.

Parameters:
entity class or individual.
prop_val value to set.
Returns:
0 on success or not otherwise.

int unset_property_for_individual ( individual_t ind,
char *  propname,
void *  data 
)

Unset property value.

Parameters:
ind individual.
propname name of property.
data value of property.
Returns:
0 on success or not otherwise.

int update_property ( void *  entity,
const char *  propname,
void *  new_data 
)

Update property with given name.

Parameters:
ind individual.
propname name of property.
new_data value of property.
Returns:
0 on success or not otherwise.

int update_property_value_data ( prop_val_t prop_value,
void *  new_data 
)

Update property value.

Parameters:
prop_value value of property.
new_data new value of property.
Returns:
0 on success or not otherwise.

int update_property_with_data ( void *  entity,
const char *  propname,
const void *  old_data,
void *  new_data 
)

Update property using old value.

Parameters:
ind individual.
propname name of property.
old_data old value of property.
new_data new value of property.
Returns:
0 on success or not otherwise.


doxygen