NAME
OTC_Bucket -
Bucket to hold an instance of type T.
SYNOPSIS
#include <OTC/collctn/bucket.hh>
template<class T>
class OTC_Bucket : public OTC_Link
{
public:
static os_typespec* get_os_typespec();
~OTC_Bucket();
OTC_Bucket(T const& aItem);
inline T& item();
};
CLASS TYPE
Concrete
DESCRIPTION
This class is a holder for an item of type T within a linked
list. In order to manage resources, when parameterised over
a pointer type, it is possible to define an explicit version
of OTC_BaseActions. This allows specific actions to be performed
at the point that an object is added into the bucket, and when the
bucket is deleted.
DESTRUCTION
~OTC_Bucket();
Invokes OTC_BaseActions<T>::remove()
on the item in the bucket.
INITIALISATION
OTC_Bucket(T const& aItem);
Creates a bucket containing aItem.
Invokes OTC_BaseActions<T>::add()
on the item, at the point of placing
it into the bucket.
RETRIEVAL
inline T& item();
Returns the item being held by this
bucket.
SEE ALSO
OTC_Link, OTC_Linkable, OTC_Anchor, OTC_BaseActions
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1991 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED