00001 /* 00002 * classes.h - describe functions for work with classes. 00003 * This file is part of PetrSU KP library. 00004 * 00005 * Copyright (C) 2009 - Alexander A. Lomov. All rights reserved. 00006 * 00007 * PetrSU KP library is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * PetrSU KP library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with <program name>; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, 00020 * Boston, MA 02110-1301 USA 00021 */ 00022 00023 #include "structures.h" 00024 #include "utils/kp_debug.h" 00025 00026 #ifndef _CLASSES_H 00027 #define _CLASSES_H 00028 00029 00030 /* Functions for work with classes and properties */ 00031 individual_t* new_individual(const class_t *classtype); 00032 list_t* get_superclasses(const class_t *class); 00033 int is_subclassof(const class_t *class, const class_t *super_class); 00034 int is_classtype_of(const individual_t *individual, const class_t *prent_class); 00035 int count_references_to_individual(individual_t *individual); 00036 int set_uuid(individual_t *ind, const char *uuid); 00037 00038 /* Functions for add/remove entities to repositories */ 00039 int add_entity_to_repository(void *entity); 00040 int add_class_to_repository(class_t *class); 00041 int add_property_to_repository(property_t *property); 00042 void remove_entity_from_repository(void *entity); 00043 void clean_repositories(); 00044 00045 /* Functions for get data from repositories */ 00046 const property_t* get_property_from_repository_by_name(const char *name); 00047 const class_t* get_class_from_repository_by_classtype(const char *classtype); 00048 const individual_t* get_individual_from_repository_by_uuid(const char *uuid); 00049 const list_t* get_individuals_from_repository_by_classtype(const char *classtype); 00050 00051 #endif /* _CLASSES_H */