#include "structures.h"
#include "properties.h"
#include "classes.h"
#include "utils/list.h"
#include "utils/check_func.h"
#include "ss_func.h"
#include "kpi_low.h"
Go to the source code of this file.
Functions | |
int | ss_update_property_with_data (individual_t *ind, char *propname, void *old_data, void *new_data) |
Updates property of individual in SS and localy. | |
int | ss_remove_properties_by_name (individual_t *ind, char *propname) |
Removes all properties with given name for individual in SS and localy. | |
int | ss_remove_property_by_value_struct (individual_t *ind, prop_val_t *prop_val) |
Removes all properties with given name and value for individual in SS and localy. | |
int | ss_set_property (void *entity, char *propname, void *data) |
Sets property for entity in SS and localy by name. | |
int | ss_set_property_with_value_struct (void *entity, prop_val_t *prop_val) |
Sets property for entity in SS and localy by name. | |
prop_val_t * | ss_get_property (individual_t *ind, char *propname) |
Gets property for individual from SS by name. | |
prop_val_t * | ss_get_property_with_data (individual_t *ind, char *propname, void *data) |
Gets first founded property for individual from SS by name and value. | |
list_t * | ss_get_properties (individual_t *ind, char *propname, int max) |
Gets list of properties for individual from SS by name and value. | |
bool | ss_has_property_value (individual_t *ind, char *propname, void *data) |
Checks if individual has property with given value. | |
int | ss_set_property_for_individual (individual_t *ind, char *propname, void *data) |
int | ss_set_property_for_class (class_t *ind, char *propname, void *data) |
Vanag Pavel <vanag@cs.karelia.ru>
PetrSU KP library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with <program name>; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
ss_set_property(); ss_set_property_with_value_struct(); ss_get_property(); ss_get_property_with_data(); ss_update_property_with_data(); ss_remove_properties_by_name(); ss_remove_property_by_value_struct(); ss_get_properties(); ss_has_property_value();
list_t* ss_get_properties | ( | individual_t * | ind, | |
char * | propname, | |||
int | max | |||
) |
Gets list of properties for individual from SS by name and value.
Gets the property from the SS by name and value and returns list of properties. Returns all founded but not more then max. Function sets global PetrSU KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Pointer to the char array with name. |
[in] | int | max. Maximum returns properties. |
prop_val_t* ss_get_property | ( | individual_t * | ind, | |
char * | propname | |||
) |
Gets property for individual from SS by name.
Gets the property from the SS by name and returns it. Function sets global PetrSU KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Pointer to the char array with name. |
prop_val_t* ss_get_property_with_data | ( | individual_t * | ind, | |
char * | propname, | |||
void * | data | |||
) |
Gets first founded property for individual from SS by name and value.
Gets the property from the SS by name and value and returns first founded. Function sets global PetrSU KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Pointer to the char array with name. |
[in] | void | *data. Pointer to the value. |
bool ss_has_property_value | ( | individual_t * | ind, | |
char * | propname, | |||
void * | data | |||
) |
Checks if individual has property with given value.
Checks if individual has property with given name and value. Function sets global PetrSU KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Pointer to the char array with name. |
[in] | void | *data. Pointer to the value. |
int ss_remove_properties_by_name | ( | individual_t * | ind, | |
char * | propname | |||
) |
Removes all properties with given name for individual in SS and localy.
Finds properties with given name for individual and removes it from SS. Then try find all local property with given name and remove it. After all you have a struct without removed properties. Function sets global PetrSU KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Char array with name of property. |
int ss_remove_property_by_value_struct | ( | individual_t * | ind, | |
prop_val_t * | prop_val | |||
) |
Removes all properties with given name and value for individual in SS and localy.
Get name and value from value struct, finds properties with given name and value for individual and removes it from SS. Then try find all local property with given name and value and remove it. After all you have a struct without removed properties. Function sets global PetrSU KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | prop_val_t | *prop_val. Pointer to the value struct. |
int ss_set_property | ( | void * | entity, | |
char * | propname, | |||
void * | data | |||
) |
Sets property for entity in SS and localy by name.
Checks either entity is individual or class Checks entity correctness: cardinality, property values limitation and sets property for entity in SS and localy. Function sets global PetrSU KP Library's errno.
[in] | void | *entity. Pointer to the individual struct. |
[in] | char | *propname. Pointer to the char array with name. |
[in] | void | *data. Pointer to the value. |
int ss_set_property_for_class | ( | class_t * | ind, | |
char * | propname, | |||
void * | data | |||
) |
int ss_set_property_for_individual | ( | individual_t * | ind, | |
char * | propname, | |||
void * | data | |||
) |
int ss_set_property_with_value_struct | ( | void * | entity, | |
prop_val_t * | prop_val | |||
) |
Sets property for entity in SS and localy by name.
Checks either entity is individual or class Checks entity correctness: cardinality, property values limitation and sets property for entity in SS and localy. Function sets global PetrSU KP Library's errno.
[in] | void | *entity. Pointer to the individual struct. |
[in] | prop_val_t | *prop_val. Pointer to the value struct. |
int ss_update_property_with_data | ( | individual_t * | ind, | |
char * | propname, | |||
void * | old_data, | |||
void * | new_data | |||
) |
Updates property of individual in SS and localy.
Checks individual correctness: cardinality, prop- erty values limitation, and converts the individual’s given properties to triplets, which will be updated in SS, other properties not changed in SS. Same localy. Function sets global PetrSU KP Library's errno.
[in] | individual_t | * ind. Pointer to the individual struct. |
[in] | char | *propname. Char array with name of property. |
[in] | void | *old_data. Pointer to the old value (DATATYPE or OBJECTTYPE). |
[in] | void | *new_data. Pointer to the new value (DATATYPE or OBJECTTYPE). |