HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_CycleDetect< T >::AutoScope Class Reference

#include <UT_Algorithm.h>

Public Member Functions

 AutoScope (UT_CycleDetect< T > *cycle)
 
 ~AutoScope ()
 
void reset ()
 

Detailed Description

template<typename T>
class UT_CycleDetect< T >::AutoScope

Helper class for automatically saving and restoring the state of the cycle detection within a scope block.

Example:

T walk;
UT_CycleDetect<T> cycle;
.....
{
    UT_CycleDetect<T>::AutoScope cycle_detect_scope(cycle);
    if (!cycle.detect(<some_object>))
    {
        ... do some work that may recursively update the cycle ...
    }
    else
    {
        ... cycle detected.  Do work to report/handle cycle ...

        cycle_detect_scope.reset();
    }

Definition at line 82 of file UT_Algorithm.h.

Constructor & Destructor Documentation

template<typename T>
UT_CycleDetect< T >::AutoScope::AutoScope ( UT_CycleDetect< T > *  cycle)
inline

Definition at line 85 of file UT_Algorithm.h.

template<typename T>
UT_CycleDetect< T >::AutoScope::~AutoScope ( )
inline

Definition at line 94 of file UT_Algorithm.h.

Member Function Documentation

template<typename T>
void UT_CycleDetect< T >::AutoScope::reset ( void  )
inline

Definition at line 108 of file UT_Algorithm.h.


The documentation for this class was generated from the following file: