Inter4ql  5.2
Disposable.h
1 #ifndef __DISPOSABLE_H__
2 #define __DISPOSABLE_H__
3 
4 #include <vector>
5 #include <map>
6 
7 namespace Inter4ql {
10  struct disp_type {
11  enum type {
12  PROGRAM,
13  MODULE_LOCAL_VECTOR,
14  MODULE_LOCAL,
15  MODULE_GROUP,
16  MEMBERS_VECTOR,
17  DOMAIN_VECTOR,
18  DOMAIN_suf,
19  RELATION_VECTOR,
20  RELATION,
21  RULE_VECTOR,
22  RULE,
23  FACT_VECTOR,
24  FACT,
25  FACT_VECTOR_VECTOR,
26  VALUE_VECTOR,
27  VALUE,
28  MODULE_BELIEF,
29  MODULE_ACTION,
30  MODULE_PROBLEM,
31  CONSTRAINTS,
32  CONSTRAINT_ENTRY,
33  QUANTIFIER_ENTRY,
34  QUANTIFIERS_VECTOR,
35  CONSTRAINT_ENTRY_VECTOR,
36  EXPRESSION_VECTOR,
37  EXPRESSION,
38  };
39  };
40 
43  class Disposable {
44  public:
48  Disposable();
52  ~Disposable();
58  void add(void* address, disp_type::type object_type);
64  void remove(void* address, disp_type::type object_type);
68  void clear();
72  static bool errorMode;
73  private:
74  std::map<disp_type::type, std::vector<void*>*>* objects;
75  bool debug;
76  };
77 }
78 
79 #endif /* __DISPOSABLE_H__ */
80 
structure that handles memory managment - adds objecst and frees them
Definition: Disposable.h:43
Definition: Application.cc:37
static bool errorMode
if true, destructors in objects will not free their internals
Definition: Disposable.h:72
Enumeration type for types of objects that can be stored in Disposable object.
Definition: Disposable.h:10