sipxportlib  Version 3.3
Public Member Functions | Static Public Attributes | List of all members
UtlCopyableContainable Class Referenceabstract

#include <UtlCopyableContainable.h>

Inheritance diagram for UtlCopyableContainable:
Inheritance graph
[legend]
Collaboration diagram for UtlCopyableContainable:
Collaboration graph
[legend]

Public Member Functions

virtual UtlCopyableContainableclone () const =0
 Make an off the heap copy of this object. More...
 
 UtlCopyableContainable ()
 
virtual ~UtlCopyableContainable ()
 
virtual UtlContainableType getContainableType () const
 
virtual UtlBoolean isInstanceOf (const UtlContainableType type) const
 Determine if this object is a derivative of the specified UtlContainableType. More...
 
- Public Member Functions inherited from UtlContainable
virtual ~UtlContainable ()
 
virtual unsigned hash () const =0
 Calculate a hash code for this object. More...
 
unsigned directHash () const
 Provides a hash function that uses the object pointer as the hash value. More...
 
virtual int compareTo (UtlContainable const *) const =0
 Compare this object to another object. More...
 
virtual UtlBoolean isEqual (UtlContainable const *) const
 Test this object to another object for equality. More...
 

Static Public Attributes

static const UtlContainableType TYPE = "UtlCopyableContainable"
 
- Static Public Attributes inherited from UtlContainable
static const UtlContainableType TYPE = "UtlContainable"
 

Additional Inherited Members

- Static Public Member Functions inherited from UtlContainable
static unsigned stringHash (char const *value)
 Provides a hash function appropriate for null-terminated string values. More...
 
static UtlBoolean areSameTypes (const UtlContainableType type1, const UtlContainableType type2)
 Are UtlContainable types the same. More...
 

Detailed Description

UtlCopyableContainable is a containable that must implement a clone method, that is used by UtlCopyableSList in order to assign/copy list elements on list copy.

Derived classes should also implement a copy constructor and an equals operator.

Sample clone implementation: SampleClass* clone() const { return new SampleClass(*this); }

Constructor & Destructor Documentation

~UtlCopyableContainable ( )
virtual

Member Function Documentation

virtual UtlCopyableContainable* clone ( ) const
pure virtual

Make an off the heap copy of this object.

< Class type used for runtime checking

Implemented in UtlString, UtlInt, UtlBool, and UtlIntPtr.

UtlContainableType getContainableType ( ) const
virtual

Get the ContainableType for a UtlContainable-derived class.

Implements UtlContainable.

Reimplemented in UtlString, UtlInt, UtlIntPtr, and UtlBool.

UtlBoolean isInstanceOf ( const UtlContainableType  type) const
virtual

Determine if this object is a derivative of the specified UtlContainableType.

Determine if this object is an instance of the designated runtime class identifer or one of its derivatives. For example:

if (pMyObject->isInstanceOf(UtlInt::TYPE))
{
    ...
}

If you want to determine if this object is exactly the same type as the given type (i.e. not a deriviative) use the following:

if(myObject->getContainableType() == UtlInt::TYPE)
{
    ...
}
Returns
TRUE/FALSE if this object is of the given type or a derivative of the given type.

Reimplemented from UtlContainable.

Reimplemented in UtlString, UtlInt, UtlIntPtr, and UtlBool.

Member Data Documentation

UtlContainableType TYPE = "UtlCopyableContainable"
static