NAME

OTC_MCObject - Mixin class for memory cluster objects.

SYNOPSIS


#include <OTC/memory/mcobject.hh>

class OTC_MCObject
{
  public:
    void* operator new(size_t theSize, OTC_Cluster& theCluster);
  protected:
    void* operator new(size_t);
    OTC_MCObject();
    inline void operator delete(void*);
    virtual ~OTC_MCObject();
};

CLASS TYPE

Abstract

DESCRIPTION

The OTC_MCObject class is a mixin class which gives to a derived object the ability to be allocated within a memory cluster. Allocation within a cluster is achieved through an overloaded version of operator new() which takes an instance of OTC_Cluster as argument. Objects do not have to be deleted explicitly, all objects in the cluster being automatically destroyed when the cluster is destroyed. Destructors for derived classes will be called.

EXAMPLE

ALLOCATION

void* operator new(size_t theSize, OTC_Cluster& theCluster);

INITIALISATION

OTC_MCObject();

DELETION

inline void operator delete(void*);

NOTES

A derived class destructor should have protected access to prevent creation of the class in any context except that of a cluster.

SEE ALSO

OTC_Cluster

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1994 TELSTRA CORPORATION LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED