SemOpt  0.2alpha2-SCC
SetArguments Class Reference

Class encompassing a set of arguments. More...

Public Member Functions

 SetArguments ()
 Simple constructor.
void add_Argument (Argument *)
 Add an argument to the set.
ArgumentgetArgumentByName (string)
 This method returns the pointer to the Argument whose name is given as parameter.
ArgumentgetArgumentByNumber (int num)
 This method returns the pointer to the Argument whose identification number is given as parameter.
int cardinality () const
 Retuns the cardinality of this set.
bool empty ()
 Check wether or not this set is empty.
SetArgumentsIterator begin () const
 Begin of the iterator for this set of arguments.
SetArgumentsIterator end () const
 End of the iterator for this set of arguments.
bool exists (Argument *)
 Check whether or not an argument exists in this set.
bool is_subset_equal (SetArguments *)
 Check whether this set is a subset of other
bool is_subset (SetArguments *)
 Check whether this set is a proper subset of other
void intersect (SetArguments *, SetArguments *)
 Intersect this set the other set and write the result in res
void setminus (SetArguments *, SetArguments *)
 Setmisun.
void remove (Argument *)
 Remove an argument from this set.
void clone (SetArguments *)
 Clone this set.
bool operator== (const SetArguments &other) const
 Overloading of the == operator.

Detailed Description

Class encompassing a set of arguments.

Author
Federico Cerutti feder.nosp@m.ico..nosp@m.cerut.nosp@m.ti@a.nosp@m.cm.or.nosp@m.g

Definition at line 34 of file SetArguments.h.

Member Function Documentation

void SetArguments::add_Argument ( Argument arg)

Add an argument to the set.

Parameters
[in]argPointer to an Argument

Definition at line 24 of file SetArguments.cpp.

References Argument::getName(), and Argument::getNumber().

Referenced by Argument::add_attackers(), Argument::add_attacks(), Labelling::add_label(), intersect(), and AF::readFile().

SetArgumentsIterator SetArguments::begin ( ) const

Begin of the iterator for this set of arguments.

Return values
SetArgumentsIteratorAn iterator pointing at the first of the elements of this set

Definition at line 72 of file SetArguments.cpp.

Referenced by AF::begin(), clone(), intersect(), is_subset_equal(), operator==(), and setminus().

int SetArguments::cardinality ( ) const

Retuns the cardinality of this set.

Return values
int

Definition at line 34 of file SetArguments.cpp.

Referenced by is_subset(), is_subset_equal(), AF::numArgs(), and operator==().

void SetArguments::clone ( SetArguments set)

Clone this set.

Parameters
[in]setThe set that will be the new clone
Return values
void

Definition at line 164 of file SetArguments.cpp.

References begin(), and end().

Referenced by setminus().

bool SetArguments::empty ( )

Check wether or not this set is empty.

Return values
bool

Definition at line 63 of file SetArguments.cpp.

Referenced by Labelling::empty(), and is_subset_equal().

SetArgumentsIterator SetArguments::end ( ) const

End of the iterator for this set of arguments.

Return values
SetArgumentsIteratorAn iterator pointing at the last of the elements of this set

Definition at line 81 of file SetArguments.cpp.

Referenced by clone(), AF::end(), intersect(), is_subset_equal(), operator==(), and setminus().

bool SetArguments::exists ( Argument arg)

Check whether or not an argument exists in this set.

Parameters
[in]arg
Return values
bool

Definition at line 144 of file SetArguments.cpp.

References Argument::getName().

Referenced by is_subset_equal(), and setminus().

Argument * SetArguments::getArgumentByName ( string  name)

This method returns the pointer to the Argument whose name is given as parameter.

Parameters
[in]nameThe name of the argument
Return values
Argument*The pointer to the Argument object, or NULL if not found

Definition at line 44 of file SetArguments.cpp.

Referenced by AF::getArgumentByName().

Argument * SetArguments::getArgumentByNumber ( int  num)

This method returns the pointer to the Argument whose identification number is given as parameter.

Parameters
[in]numThe name of the argument
Return values
Argument*The pointer to the Argument object, or NULL if not found

Definition at line 54 of file SetArguments.cpp.

Referenced by AF::getArgumentByNumber().

void SetArguments::intersect ( SetArguments other,
SetArguments res 
)

Intersect this set the other set and write the result in res

Parameters
[in]otherThe other term of the intersection
[out]resThe result of the intersection
Return values
void

Definition at line 178 of file SetArguments.cpp.

References add_Argument(), begin(), and end().

bool SetArguments::is_subset ( SetArguments other)

Check whether this set is a proper subset of other

Parameters
[in]otherThe other set to check
Return values
bool

Definition at line 114 of file SetArguments.cpp.

References cardinality(), and is_subset_equal().

bool SetArguments::is_subset_equal ( SetArguments other)

Check whether this set is a subset of other

Parameters
[in]otherThe other set to check
Return values
bool

Definition at line 91 of file SetArguments.cpp.

References begin(), cardinality(), empty(), end(), and exists().

Referenced by is_subset().

bool SetArguments::operator== ( const SetArguments other) const

Overloading of the == operator.

Parameters
[in]otherThe other term of the comparison
Return values
bool

Definition at line 198 of file SetArguments.cpp.

References begin(), cardinality(), and end().

void SetArguments::remove ( Argument arg)

Remove an argument from this set.

Parameters
[in]arg
Return values
void

Definition at line 154 of file SetArguments.cpp.

References Argument::getName().

Referenced by setminus().

void SetArguments::setminus ( SetArguments other,
SetArguments result 
)

Setmisun.

Parameters
[in]otherThe other term of the subtraction
[out]resThe result of the subtraction
Return values
void

Definition at line 129 of file SetArguments.cpp.

References begin(), clone(), end(), exists(), and remove().


The documentation for this class was generated from the following files: