SmartHandle Class Reference
 
 
 
SmartHandle Class Reference

This reference page is linked to from the following overview topics: About SmartHandle, About RenderItem.


#include <SmartHandle.h>

Inheritance diagram for SmartHandle:
Noncopyable MaxHeapOperators BaseMaterialHandle BaseRasterHandle ImmediateFragment IndexBufferHandle RenderItemHandle RenderNodeHandle VertexBufferHandle HLSLMaterialHandle SolidColorMaterialHandle StandardMaterialHandle TextureMaterialHandle VertexColorMaterialHandle TargetHandle TextureHandle CustomRenderItemHandle GeometryRenderItemHandle ImmediateRenderItemHandle RenderItemHandleDecorator

Class 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.

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