model.h
Go to the documentation of this file.
1 
9 #ifndef _MODEL_H_
10 #define _MODEL_H_
11 
12 #include <string.h>
13 
14 #include "model-attribute.h"
15 #include "vector.h"
16 
20 typedef struct Model {
31  Vector(char*) rel;
32 } Model;
33 
38 void initModel(Model* mdl);
39 
44 void freeModel(Model* mdl);
45 
54 int getEnumId(const char* str, Model* mdl, unsigned int index);
55 
64 int getTreeId(const char* str, Model* mdl, unsigned int index);
65 
74 char* getEnumStr(int id, Model* mdl, unsigned int index);
75 
84 char* getTreeStr(int id, Model* mdl, unsigned int index);
85 
86 #endif // _MODEL_H_
Vector(ModelAttribute) ma
An array of attributes definition. Allow to know which attribute is ruled by which rules...
void freeModel(Model *mdl)
Free the Model structure (created while parsing the config file)
Definition: model.c:32
struct Model Model
Contains the attributes and relations definitions found in the model file.
Contains the attributes and relations definitions found in the model file.
Definition: model.h:20
Contains the definition of an attribute and its type.
Definition: model-attribute.h:21
void initModel(Model *mdl)
Initialize the Model.
Definition: model.c:28
int getEnumId(const char *str, Model *mdl, unsigned int index)
Returns the identifier of the enumeration item whose name is given as a parameter.
Definition: model.c:50
char * getTreeStr(int id, Model *mdl, unsigned int index)
Returns the name of the tree node or tree leaf whose identifier is given as a parameter.
Definition: model.c:93
Contains the definition of the vectors (dynamic & generic arrays)
int getTreeId(const char *str, Model *mdl, unsigned int index)
Returns the identifier of the tree node or tree leaf whose name is given as a parameter.
Definition: model.c:78
char * getEnumStr(int id, Model *mdl, unsigned int index)
Returns the name of the enumeration item whose identifier is given as a parameter.
Definition: model.c:82
Contains the definition of the ModelAttribute.