properties.h File Reference

#include "structures.h"
#include "utils/list.h"
#include "utils/check_func.h"

Go to the source code of this file.

Functions

const property_tget_property_type (const class_t *class, const char *propname)
 Get property struct by given name.
int set_property_by_name (void *entity, char *propname, void *data)
 Set new property for entity.
int set_property (void *entity, property_t *property, void *value)
 Set new property for entity.
int set_property_with_value_struct (void *entity, const prop_val_t *prop_val)
const prop_val_tget_property (individual_t *ind, const char *propname)
 Get property by 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 update_property_value_data (prop_val_t *prop_value, void *new_data)
int unset_property_for_individual (individual_t *ind, char *propname, void *data)
 Unset property value.
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 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_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_value_struct ( void *  entity,
const prop_val_t prop_val 
)

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 
)

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