HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::util::NullInterrupter Struct Reference

Base class for interrupters. More...

#include <NullInterrupter.h>

Public Member Functions

 NullInterrupter ()=default
 Default constructor. More...
 
virtual ~NullInterrupter ()=default
 
virtual void start (const char *name=nullptr)
 
virtual void end ()
 Signal the end of an interruptible operation. More...
 
virtual bool wasInterrupted (int percent=-1)
 
virtual NullInterrupterinterrupter () final
 Convenience method to return a reference to the base class from a derived class. More...
 

Detailed Description

Base class for interrupters.

The host application calls start() at the beginning of an interruptible operation, end() at the end of the operation, and wasInterrupted() periodically during the operation. If any call to wasInterrupted() returns true, the operation will be aborted.

Note
This interrupter was not virtual in a previous implementation, so it could be compiled out, however it remains important to not call wasInterrupter() too frequently so as to balance performance and the ability to interrupt an operation.

Definition at line 25 of file NullInterrupter.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::util::NullInterrupter::NullInterrupter ( )
default

Default constructor.

virtual openvdb::OPENVDB_VERSION_NAME::util::NullInterrupter::~NullInterrupter ( )
virtualdefault

Member Function Documentation

virtual void openvdb::OPENVDB_VERSION_NAME::util::NullInterrupter::end ( void  )
inlinevirtual

Signal the end of an interruptible operation.

Definition at line 34 of file NullInterrupter.h.

virtual NullInterrupter& openvdb::OPENVDB_VERSION_NAME::util::NullInterrupter::interrupter ( )
inlinefinalvirtual

Convenience method to return a reference to the base class from a derived class.

Definition at line 41 of file NullInterrupter.h.

virtual void openvdb::OPENVDB_VERSION_NAME::util::NullInterrupter::start ( const char *  name = nullptr)
inlinevirtual

Signal the start of an interruptible operation.

Parameters
namean optional descriptive name for the operation

Definition at line 32 of file NullInterrupter.h.

virtual bool openvdb::OPENVDB_VERSION_NAME::util::NullInterrupter::wasInterrupted ( int  percent = -1)
inlinevirtual

Check if an interruptible operation should be aborted.

Parameters
percentan optional (when >= 0) percentage indicating the fraction of the operation that has been completed
Note
this method is assumed to be thread-safe.

Definition at line 39 of file NullInterrupter.h.


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