SemOpt  0.2alpha5-SCC
Argument.cpp
Go to the documentation of this file.
1 
9 #include "Argument.h"
10 
17 Argument::Argument(string name, int num, AF *theaf)
18 {
19  this->name = name;
20  this->number = num;
21  this->af = theaf;
22  this->attackers = new SetArguments();
23  this->attacks = new SetArguments();
24 }
25 
26 Argument::~Argument()
27 {
28  // TODO Auto-generated destructor stub
29 }
30 
35 string Argument::getName() const
36 {
37  return this->name;
38 }
39 
45 {
46  return this->number;
47 }
48 
55 {
56  return this->number + 1;
57 }
58 
65 {
66  return this->number + 1 + this->af->numArgs();
67 }
68 
75 {
76  return this->number + 1 + 2 * this->af->numArgs();
77 }
78 
85 {
86  return NOT(this->InVar());
87 }
88 
95 {
96  return NOT(this->OutVar());
97 }
98 
105 {
106  return NOT(this->UndecVar());
107 }
108 
114 bool Argument::operator==(const Argument &other) const
115 {
116  if (this->name == other.getName() &&
117  this->number == other.getNumber())
118  return true;
119  else
120  return false;
121 }
122 
128 bool Argument::operator!=(const Argument &other) const
129 {
130  if (this->name == other.getName() &&
131  this->number == other.getNumber())
132  return false;
133  else
134  return true;
135 }
136 
143 {
144  this->attacks->add_Argument(arg);
145 }
146 
153 {
154  this->attackers->add_Argument(arg);
155 }
156 
162 {
163  return this->attacks;
164 }
165 
171 {
172  return this->attackers;
173 }
174 
180 {
181  return this->af;
182 }