SmartHandle Class Reference


Detailed Description

This is the base wrapper class for all graphics primitive classes in max viewport: worlds, nodes, render items, materials, etc.

It contains internal graphics object pointer and holds a reference to that pointer. It will release its reference to graphics object in its destructor.

Note this is not for generic smart handle use.

#include <SmartHandle.h>

Inheritance diagram for SmartHandle:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual GraphicsDriverAPI  ~SmartHandle ()
  destructor
GraphicsDriverAPI bool  IsValid () const
  Check if this handle is valid.
GraphicsDriverAPI void  Release ()
  Release the underlying graphics objects.
GraphicsDriverAPI Identifier  GetObjectID () const
  Get the underlying graphics object id.
GraphicsDriverAPI void  SetPointer (void *pObject)
GraphicsDriverAPI void *  GetPointer () const
  Get the underlying graphics object pointer.
bool  operator== (const SmartHandle &rhs) const
bool  operator!= (const SmartHandle &rhs) const
bool  operator< (const SmartHandle &rhs) const
bool  operator<= (const SmartHandle &rhs) const
bool  operator> (const SmartHandle &rhs) const
bool  operator>= (const SmartHandle &rhs) const

Protected Member Functions

GraphicsDriverAPI  SmartHandle ()

Protected Attributes

void *  mpObject

Constructor & Destructor Documentation

virtual GraphicsDriverAPI ~SmartHandle ( ) [virtual]

destructor

GraphicsDriverAPI SmartHandle ( ) [protected]

Member Function Documentation

GraphicsDriverAPI bool IsValid ( ) const

Check if this handle is valid.

User should never call member functions of an invalid handle.

GraphicsDriverAPI void Release ( )

Release the underlying graphics objects.

After calling this function, any function of the same SmartHandle instance should not be used.

GraphicsDriverAPI Identifier GetObjectID ( ) const

Get the underlying graphics object id.

This function is internally used only.

GraphicsDriverAPI void SetPointer ( void *  pObject )
GraphicsDriverAPI void* GetPointer ( ) const

Get the underlying graphics object pointer.

This function is internally used only.

bool operator== ( const SmartHandle rhs ) const [inline]
                                                           {
        return mpObject == rhs.mpObject;
    }
bool operator!= ( const SmartHandle rhs ) const [inline]
                                                           {
        return mpObject != rhs.mpObject;
    }
bool operator< ( const SmartHandle rhs ) const [inline]
                                                          {
        return mpObject < rhs.mpObject;
    }
bool operator<= ( const SmartHandle rhs ) const [inline]
                                                           {
        return mpObject <= rhs.mpObject;
    }
bool operator> ( const SmartHandle rhs ) const [inline]
                                                          {
        return mpObject > rhs.mpObject;
    }
bool operator>= ( const SmartHandle rhs ) const [inline]
                                                           {
        return mpObject >= rhs.mpObject;
    }

Member Data Documentation


SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle
SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle SmartHandle