00001
00035 #include <stdio.h>
00036 #include <stdlib.h>
00037 #include "utils/kp_bool.h"
00038 #include "utils/list.h"
00039
00040 #ifndef _STRUCTURES_H
00041 #define _STRUCTURES_H
00042
00043
00044
00045
00046
00048
00052 enum rtti_types {
00053 RTTI_MIN_VALUE = 0,
00054 RTTI_INDIVIDUAL = 1,
00055 RTTI_CLASS = 2,
00056 RTTI_PROPERTY = 3,
00057 RTTI_SBRC_CONTAINER,
00058 RTTI_MAX_VALUE
00059 };
00060
00061
00065 enum property_types {
00066 DATATYPEPROPERTY = 1,
00067 OBJECTPROPERTY = 2
00068 };
00069
00071
00073
00077 enum subscribe_status {
00078 SBCR_STATUS_MIN,
00079 SBCR_STATUS_NO,
00080 SBCR_STATUS_SUBSCRIBED,
00081 SBCR_STATUS_UPDATING,
00082 SBCR_STATUS_MAX
00083 };
00084
00086
00087
00088
00089
00090
00091
00092
00094
00098 typedef struct property_s {
00099 int rtti;
00100 int type;
00101 char *name;
00102 char *domain;
00103 char *about;
00104 list_t *subpropertyof;
00105 list_t *oneof;
00106 int mincardinality;
00107 int maxcardinality;
00108 } property_t;
00109
00110
00116 typedef struct prop_val_s {
00117 property_t *property;
00118 void *prop_value;
00119 } prop_val_t;
00120
00121
00125 typedef struct class_s {
00126 int rtti;
00127 char *classtype;
00128 list_t *superclasses;
00129 list_t *oneof;
00130 list_t *properties;
00131 list_t *instances;
00132 } class_t;
00133
00134
00138 typedef struct individual_s {
00139 int rtti;
00140 char *uuid;
00141 char *classtype;
00142 list_t *properties;
00143 const class_t *parent_class;
00144 int subscribe_status;
00145 } individual_t;
00146
00148
00149
00150
00151
00152
00153
00155
00156 void free_property(property_t *property);
00157 void free_property_value_with_func(prop_val_t *prop_val, void (*free_data_func)(void*));
00158 void free_class(class_t *class);
00159 void free_individual(individual_t *individual);
00160
00161 prop_val_t* new_prop_value(property_t *prop, void *data);
00162
00163 int get_rtti_type(const void* entity);
00164
00166
00167
00169
00170 int get_sbcr_status(individual_t *individual);
00171 int set_sbcr_status(individual_t *individual, int status);
00172
00174
00175
00176
00177 #endif