![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/data/Bag.h>
Classes | |
class | Iter |
Public Member Functions | |
int | count () const |
bool | isEmpty () const |
operator bool () const | |
const T & | get (int i) const |
T & | get (int i) |
const T & | operator[] (int i) const |
T & | operator[] (int i) |
Iter | begin () const |
Iter | end () const |
bool | contains (const T &x) const |
bool | containsAll (const Bag< T > &c) const |
bool | equals (const Bag< T > &c) const |
bool | operator== (const Bag< T > &b) const |
bool | operator!= (const Bag< T > &b) const |
int | length () const |
int | indexOf (const T &x, int i=-1) const |
int | lastIndexOf (const T &x, int i=-1) const |
Static Public Member Functions | |
static void | operator delete (void *p) |
static Bag< T > * | make (int count, const T *items) |
static Bag< T > * | make (const Array< T > &a) |
static Bag * | make (const Vector< T > &v) |
A bag is a cheap collection to store an immutable array of data. The allocated data encompasses only the integer for the count and the array items. Yet, this requires a special procedure to create a bag using the function make
as below:
Yet, the release of the data is standard:
Bag implements the following concepts:
T | Type of data stored in the bag. |
|
inline |
|
inline |
Referenced by Bag< T >::containsAll().
References Bag< T >::contains().
|
inline |
Referenced by Bag< T >::equals(), Bag< T >::length(), and Bag< T >::make().
|
inline |
References Bag< T >::count(), and Bag< T >::get().
Referenced by Bag< T >::operator!=(), and Bag< T >::operator==().
|
inline |
|
inline |
Referenced by Bag< T >::equals(), Bag< T >::indexOf(), Bag< T >::lastIndexOf(), and Bag< T >::operator[]().
|
inline |
References Bag< T >::get().
|
inline |
Referenced by Bag< T >::operator bool().
|
inline |
References Bag< T >::get().
|
inline |
References Bag< T >::count().
References Array< T >::buffer(), Array< T >::count(), and Bag< T >::make().
References Vector< T, E, A >::asArray(), and Bag< T >::make().
|
inlinestatic |
References elm::array::copy(), and Bag< T >::count().
Referenced by Bag< T >::make().
|
inline |
References Bag< T >::isEmpty().
References elm::io::p().
References Bag< T >::equals().
References Bag< T >::equals().
|
inline |
References Bag< T >::get().
|
inline |
References Bag< T >::get().