|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
| BucketC<class DataC>
|
| |
| The class Bucket represents a container of items which can be addressed using an integer number (called bucket) of limited range <0, n).
|
| |
| include | "amma/Bucket.hh" |
| User Level: | Default |
| Library: | MBucket |
| Example: | exBiHash.cc |
| Section: | Containers.Misc |
| In Scope: | std |
Comments:
The structure behaves as a big object. The data item must provide
the copy constructor.
Typedefs:
- typedef UIntT BucketT;
-
An key used for addressing of buckets.
- typedef SizeT CounterT;
-
A number of items in buckets.
Variables:
- SArray1dC> buckets;
-
The set of buckets.
- BucketT minBucket;
-
The minimum saved bucket.
- BucketT maxBucket;
-
The maximum saved bucket.
Methods:
- BucketC()
-
Constructs an empty container.
- BucketC(const SizeT n)
-
Creates a bucket containing 'n' items.
- BucketC(const BucketC<DataC> & b)
-
Copy constructor. If there are more than one reference
to the same bucket, they must be treated as constant objects,
otherwise it can cause unpredictible results.
Status of the container.
------------------------
- BooleanT IsEmpty() const
-
Returns TRUE if all buckets are empty.
- BooleanT IsEmpty(const BucketT b) const
-
Returns TRUE if the bucket 'b' is empty.
- BucketT MinBucket() const
-
Returns the minimum bucket of a saved item. If the buckets
are empty, the return value can be arbitrary.
- BucketT MaxBucket() const
-
Returns the maximum bucket of a saved item. If the buckets
are empty, the return value can be arbitrary.
- CounterT N() const
-
Returns the number of items saved in all buckets.
Updating of the container.
--------------------------
- void Empty()
-
All buckets are emptied.
- void InsLast(const BucketT b,const DataC & d)
-
Inserts the item 'd' as the last item with the bucket 'b'.
- void InsFirst(const BucketT b,const DataC & d)
-
Inserts the item 'd' as the first item with the bucket 'b'.
- DataC GetFirstMin()
-
Returns the first item with the minimum bucket.
- DataC GetLastMin()
-
Returns the last item with the minimum bucket.
- DataC GetFirstMax()
-
Returns the first item with the maximum bucket.
- DataC GetLastMax()
-
Returns the last item with the maximum bucket.
- void UpdateMin()
-
Updates the minimum bucket.
- void UpdateMax()
-
Updates the maximum bucket.
- BooleanT IsEmpty(const BucketC<int>::BucketT b) const
-
- void InsLast(const BucketC<int>::BucketT b,const DataC & d)
-
- void InsFirst(const BucketC<int>::BucketT b,const DataC & d)
-
|
Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|