codac  1.5.7
codac_Contractor.h
Go to the documentation of this file.
1 
12 #ifndef __CODAC_CONTRACTOR_H__
13 #define __CODAC_CONTRACTOR_H__
14 
15 #include <vector>
16 #include <functional>
17 #include "codac_Ctc.h"
18 #include "codac_DynCtc.h"
19 #include "codac_Domain.h"
20 #include "codac_Hashcode.h"
21 
22 namespace ibex
23 {
24  class Ctc;
25 }
26 
27 namespace codac
28 {
29  class Domain;
30  class DynCtc;
31  class ContractorNetwork;
32 
33  class Contractor
34  {
35  public:
36 
37  enum class Type { T_COMPONENT, T_EQUALITY, T_IBEX, T_CODAC, T_CN };
38 
39  Contractor(Type type, const std::vector<Domain*>& v_domains);
40  Contractor(Ctc& ctc, const std::vector<Domain*>& v_domains);
41  Contractor(DynCtc& ctc, const std::vector<Domain*>& v_domains);
42  Contractor(ContractorNetwork& cn);
43  Contractor(const Contractor& ac);
44  ~Contractor();
45 
46  int id() const;
47  Type type() const;
48 
49  Ctc& ibex_ctc();
50  DynCtc& codac_ctc();
51  ContractorNetwork& cn_ctc();
52 
53  bool is_active() const;
54  void set_active(bool active);
55 
56  //std::vector<Domain*> domains();
57  const std::vector<Domain*> domains() const;
58 
59  bool operator==(const Contractor& x) const;
60 
61  void contract();
62 
63  const std::string name() const;
64  void set_name(const std::string& name);
65 
66  friend std::ostream& operator<<(std::ostream& str, const Contractor& x);
67 
68 
69  protected:
70 
71  const Type m_type;
72  bool m_active = true;
73 
74  union
75  {
76  std::reference_wrapper<Ctc> m_static_ctc;
77  std::reference_wrapper<DynCtc> m_dyn_ctc;
78  std::reference_wrapper<ContractorNetwork> m_cn_ctc;
79  };
80 
81  std::vector<Domain*> m_v_domains;
82 
83  std::string m_name;
84  int m_ctc_id;
85 
86  static int ctc_counter;
87 
88  friend class ContractorHashcode;
89  };
90 }
91 
92 #endif
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9