template<class element_t,class hash_func=id<element_t> > class adevs_set
A set can contain a single instance of an element
A hashing function must be provided that operates on the
element type (default is to use the id() function)
Inheritance:
Public Methods
-
adevs_set()
- Default constructor.
-
adevs_set(int capacity)
- Creates a set with a specified initial capacity and capacity increment value
-
adevs_set(const adevs_set<element_t, hash_func>& src)
-
Copy constructor.
-
const adevs_set<element_t,hash_func> & operator=(const adevs_set<element_t, hash_func>& src)
-
Assignment operator.
-
void add(const element_t& e)
- Adds the element to the set if it is not already a member of the set
-
void remove(int index)
- Removes the element at the specified index
-
void removeAll()
- Removes all of the elements from the set
-
bool contains(const element_t& e) const
-
Returns true if the element is in the set, and false otherwise.
-
adevs_set<element_t,hash_func> operator-(const adevs_set<element_t, hash_func>& x) const
- Set difference operator
-
adevs_set<element_t,hash_func> intersection(const adevs_set<element_t, hash_func>& x) const
- Compute the intersection of this and another set
-
~adevs_set()
- Destructor
Public Methods
-
int getSize() const
-
int getCapacity() const
-
void enlarge(int adjustment)
-
element_t& operator[](int index)
-
const element_t& get(int index) const
-
element_t& get(int index)
-
void swap(int i, int j)
-
void append(const adevs_bag<element_t>& src)
-
void erase(const element_t& e)
Documentation
A set can contain a single instance of an element
A hashing function must be provided that operates on the
element type (default is to use the id() function)
- adevs_set()
- Default constructor. Creates an empty set.
- adevs_set(int capacity)
- Creates a set with a specified initial capacity and capacity increment value
- adevs_set(const adevs_set<element_t, hash_func>& src)
-
Copy constructor. Elements are copied using the assignment operator and
copy constructor.
- const adevs_set<element_t,hash_func> & operator=(const adevs_set<element_t, hash_func>& src)
-
Assignment operator. Elements are copied using the assignment operator and
copy constructor.
- void add(const element_t& e)
- Adds the element to the set if it is not already a member of the set
- void remove(int index)
- Removes the element at the specified index
- void removeAll()
- Removes all of the elements from the set
- bool contains(const element_t& e) const
-
Returns true if the element is in the set, and false otherwise. Equality
is determined using the == operator.
- adevs_set<element_t,hash_func> operator-(const adevs_set<element_t, hash_func>& x) const
- Set difference operator
- adevs_set<element_t,hash_func> intersection(const adevs_set<element_t, hash_func>& x) const
- Compute the intersection of this and another set
- ~adevs_set()
- Destructor
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.