#include <itkSingleMultiThreader.h>
A class for performing multithreaded execution using only the calling thread.
All work is executed synchronously on the calling thread; no additional threads are created. This is efficient when the application layer is already managing parallelism (e.g., calling ITK filters from multiple threads) and internal ITK threading overhead should be avoided.
Definition at line 39 of file itkSingleMultiThreader.h.
Inheritance diagram for itk::SingleMultiThreader:
Collaboration diagram for itk::SingleMultiThreader:Public Types | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = SingleMultiThreader |
| using | Superclass = MultiThreaderBase |
Public Types inherited from itk::MultiThreaderBase | |
| using | ArrayThreadingFunctorType = std::function<void(SizeValueType)> |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = MultiThreaderBase |
| using | Superclass = Object |
| using | ThreaderEnum = MultiThreaderBaseEnums::Threader |
| using | ThreadingFunctorType = std::function<void(const IndexValueType index[], const SizeValueType size[])> |
Public Types inherited from itk::Object | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = Object |
| using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = LightObject |
Public Member Functions | |
| virtual::itk::LightObject::Pointer | CreateAnother () const |
| virtual const char * | GetNameOfClass () const |
| void | ParallelizeArray (SizeValueType firstIndex, SizeValueType lastIndexPlus1, ArrayThreadingFunctorType aFunc, ProcessObject *filter) override |
| void | ParallelizeImageRegion (unsigned int dimension, const IndexValueType index[], const SizeValueType size[], ThreadingFunctorType funcP, ProcessObject *filter) override |
| void | SetMaximumNumberOfThreads (ThreadIdType numberOfThreads) override |
| void | SetNumberOfWorkUnits (ThreadIdType numberOfWorkUnits) override |
| void | SetSingleMethod (ThreadFunctionType, void *data) override |
| void | SingleMethodExecute () override |
Public Member Functions inherited from itk::MultiThreaderBase | |
| virtual bool | GetUpdateProgress () const |
| template<unsigned int VDimension, typename TFunction> | |
| ITK_TEMPLATE_EXPORT void | ParallelizeImageRegion (const ImageRegion< VDimension > &requestedRegion, TFunction funcP, ProcessObject *filter) |
| template<unsigned int VDimension, typename TFunction> | |
| ITK_TEMPLATE_EXPORT void | ParallelizeImageRegionRestrictDirection (unsigned int restrictedDirection, const ImageRegion< VDimension > &requestedRegion, TFunction funcP, ProcessObject *filter) |
| void | SetSingleMethodAndExecute (ThreadFunctionType func, void *data) |
| virtual void | SetUpdateProgress (bool updates) |
| virtual ThreadIdType | GetMaximumNumberOfThreads () const |
| virtual ThreadIdType | GetNumberOfWorkUnits () const |
Public Member Functions inherited from itk::Object | |
| unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
| unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
| virtual void | DebugOff () const |
| virtual void | DebugOn () const |
| Command * | GetCommand (unsigned long tag) |
| bool | GetDebug () const |
| MetaDataDictionary & | GetMetaDataDictionary () |
| const MetaDataDictionary & | GetMetaDataDictionary () const |
| virtual ModifiedTimeType | GetMTime () const |
| virtual const TimeStamp & | GetTimeStamp () const |
| bool | HasObserver (const EventObject &event) const |
| void | InvokeEvent (const EventObject &) |
| void | InvokeEvent (const EventObject &) const |
| virtual void | Modified () const |
| void | Register () const override |
| void | RemoveAllObservers () |
| void | RemoveObserver (unsigned long tag) const |
| void | SetDebug (bool debugFlag) const |
| void | SetReferenceCount (int) override |
| void | UnRegister () const noexcept override |
| void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
| void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
| virtual void | SetObjectName (std::string _arg) |
| virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
| Pointer | Clone () const |
| virtual void | Delete () |
| virtual int | GetReferenceCount () const |
| void | Print (std::ostream &os, Indent indent=0) const |
Protected Member Functions | |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| SingleMultiThreader () | |
| ~SingleMultiThreader () override | |
Protected Member Functions inherited from itk::MultiThreaderBase | |
| MultiThreaderBase () | |
| ~MultiThreaderBase () override | |
Protected Member Functions inherited from itk::Object | |
| Object () | |
| bool | PrintObservers (std::ostream &os, Indent indent) const |
| virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
| ~Object () override | |
Protected Member Functions inherited from itk::LightObject | |
| virtual LightObject::Pointer | InternalClone () const |
| LightObject () | |
| virtual void | PrintHeader (std::ostream &os, Indent indent) const |
| virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
| virtual | ~LightObject () |
Friends | |
| class | ProcessObject |
Additional Inherited Members | |
Static Protected Member Functions inherited from itk::MultiThreaderBase | |
| static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ParallelizeArrayHelper (void *arg) |
| static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ParallelizeImageRegionHelper (void *arg) |
| static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | SingleMethodProxy (void *arg) |
Protected Attributes inherited from itk::MultiThreaderBase | |
| ThreadIdType | m_MaximumNumberOfThreads {} |
| ThreadIdType | m_NumberOfWorkUnits {} |
| void * | m_SingleData { nullptr } |
| ThreadFunctionType | m_SingleMethod { nullptr } |
Protected Attributes inherited from itk::LightObject | |
| std::atomic< int > | m_ReferenceCount {} |
| using itk::SingleMultiThreader::ConstPointer = SmartPointer<const Self> |
Definition at line 48 of file itkSingleMultiThreader.h.
Definition at line 47 of file itkSingleMultiThreader.h.
Standard class type aliases.
Definition at line 45 of file itkSingleMultiThreader.h.
Definition at line 46 of file itkSingleMultiThreader.h.
|
protected |
Referenced by GetNameOfClass().
|
overrideprotected |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
virtual |
Reimplemented from itk::MultiThreaderBase.
References SingleMultiThreader().
|
static |
Method for creation through the object factory.
|
overridevirtual |
Parallelize an operation over an array by executing it serially on the calling thread.
Reimplemented from itk::MultiThreaderBase.
References ProcessObject.
|
overridevirtual |
Break up region into smaller chunks. SingleThreader processes the entire region in a single call on the calling thread.
Reimplemented from itk::MultiThreaderBase.
References ProcessObject.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::MultiThreaderBase.
|
overridevirtual |
SingleThreader always uses exactly one thread.
Reimplemented from itk::MultiThreaderBase.
|
overridevirtual |
SingleThreader always uses exactly one work unit.
Reimplemented from itk::MultiThreaderBase.
|
overridevirtual |
Set the SingleMethod to f() and the UserData field of the WorkUnitInfo that is passed to it will be data.
Implements itk::MultiThreaderBase.
|
overridevirtual |
Execute the SingleMethod (as defined by SetSingleMethod) on the calling thread. NumberOfWorkUnits is always 1.
Implements itk::MultiThreaderBase.
|
friend |
Friends of Multithreader. ProcessObject is a friend so that it can call PrintSelf() on its Multithreader.
Friends of DataObject
Definition at line 100 of file itkSingleMultiThreader.h.
References ProcessObject.
Referenced by ParallelizeArray(), ParallelizeImageRegion(), and ProcessObject.