NAME
OTC_PairBucket -
Bucket containing a lookup key as well as an item.
SYNOPSIS
#include <OTC/collctn/prbucket.hh>
template<class T1, class T2>
class OTC_PairBucket : public OTC_Bucket<T2>
{
public:
static os_typespec* get_os_typespec();
OTC_PairBucket(T1 const& theKey, T2 const& theItem);
~OTC_PairBucket();
inline T1& key();
};
CLASS TYPE
Concrete
DESCRIPTION
OTC_PairBucket derives from OTC_Bucket in order that both a
key and item can be encapsulated into a single bucket. 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 the key and
item are added to the bucket, and when the bucket is deleted.
CONSTRUCTION
OTC_PairBucket(T1 const& theKey, T2 const& theItem);
Constructs a bucket holding theKey and
theItem. The appropriate
OTC_BaseActions<T>::add() function is
called on both the key and item.
DESTRUCTION
~OTC_PairBucket();
The appropriate
OTC_BaseActions<T>::remove() function
is called on both the key and item.
ACCESS
inline T1& key();
Returns the key being held by this bucket.
SEE ALSO
OTC_Bucket, OTC_BaseActions
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1993 TELSTRA CORPORATION LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED