This class describes a set: it mainly consists of a list of set elements. More...
#include <Set.h>
Public Member Functions | |
Set (const ListNode &list_of_els) | |
Construct a set from a list of elements in a SyntaxNode. | |
int | size () const |
Return the size of the set. | |
int | dim () const |
Return the dimension of the set. | |
int | findPos (const SetElement &el) const |
Find position of element in set. | |
Private Member Functions | |
void | add (const SetElement &el) |
Add element to the set. | |
std::string | toString () const |
Return the set as a string. | |
Private Attributes | |
std::map< SetElement, int, SetElement > | elements |
The actual elements: each element is
| |
int | dim_ |
Dimension: a set can be multidimensional. |
This class describes a set: it mainly consists of a list of set elements.
The element of the sets are described by the vector<string*> elements Each entry of elements is an array of strings (dimension of the array is the dimension of the set).
Set::Set | ( | const ListNode & | list | ) |
Construct a set from a list of elements in a SyntaxNode.
Constructs the Set from a list of set elements given as a tree of SyntaxNodes
list | a description of the set elements as read in from the data file |
This constructor assumes that the parameter list describes the set elements in the following format:
References add(), SyntaxNode::begin(), dim_, SyntaxNode::end(), SyntaxNode::front(), SyntaxNode::getOpCode(), and ID.
void Set::add | ( | const SetElement & | el | ) | [private] |
int Set::dim | ( | ) | const [inline] |
Return the dimension of the set.
References dim_.
Referenced by CompDescrParam::CompDescrParam(), labelToSetElement(), and CompDescrParam::toString().
int Set::findPos | ( | const SetElement & | el | ) | const |
Find position of element in set.
References elements, toString(), and SetElement::toString().
Referenced by CompDescrParam::CompDescrParam(), and labelToSetElement().
int Set::size | ( | ) | const [inline] |
Return the size of the set.
References elements.
Referenced by CompDescrParam::CompDescrParam(), and CompDescrParam::processValueTableList().
string Set::toString | ( | ) | const [private, virtual] |
Return the set as a string.
Reimplemented from CompDescr.
References elements, SetElement::getVal(), and to_string().
Referenced by findPos().
std::map<SetElement, int, SetElement> Set::elements [private] |
The actual elements: each element is
The elements of the set
Referenced by add(), findPos(), size(), and toString().