SimpleITK  2.0.0
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
itk::simple::FunctionCommand Class Reference

A Command class which allows setting an external function, or member function. More...

#include <sitkFunctionCommand.h>

+ Inheritance diagram for itk::simple::FunctionCommand:
+ Collaboration diagram for itk::simple::FunctionCommand:

Public Types

using Self = FunctionCommand
 

Public Member Functions

void Execute () override
 
 FunctionCommand ()
 
void SetCallbackFunction (const std::function< void()> &)
 
template<class T >
void SetCallbackFunction (T *object, void(T::*pMemberFunction)())
 
void SetCallbackFunction (void(*pFunction)())
 
void SetCallbackFunction (void(*pFunction)(void *), void *clientData)
 
 ~FunctionCommand () override
 
- Public Member Functions inherited from itk::simple::Command
 Command ()
 Default Constructor. More...
 
virtual std::string GetName () const
 
virtual void SetName (const std::string &name)
 
virtual ~Command ()
 

Private Types

using FunctionObjectType = std::function< void()>
 

Private Attributes

FunctionObjectType m_Function
 

Additional Inherited Members

- Protected Member Functions inherited from itk::simple::Command
virtual size_t AddProcessObject (itk::simple::ProcessObject *o)
 
virtual bool GetOwnedByProcessObjects () const
 
virtual void OwnedByProcessObjectsOff ()
 
virtual void OwnedByProcessObjectsOn ()
 
virtual size_t RemoveProcessObject (const itk::simple::ProcessObject *o)
 
virtual void SetOwnedByProcessObjects (bool o)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 

Detailed Description

A Command class which allows setting an external function, or member function.

Definition at line 33 of file sitkFunctionCommand.h.

Member Typedef Documentation

◆ FunctionObjectType

using itk::simple::FunctionCommand::FunctionObjectType = std::function<void()>
private

Definition at line 71 of file sitkFunctionCommand.h.

◆ Self

Definition at line 38 of file sitkFunctionCommand.h.

Constructor & Destructor Documentation

◆ ~FunctionCommand()

itk::simple::FunctionCommand::~FunctionCommand ( )
override

◆ FunctionCommand()

itk::simple::FunctionCommand::FunctionCommand ( )

Member Function Documentation

◆ Execute()

void itk::simple::FunctionCommand::Execute ( )
overridevirtual

The method that defines action to be taken by the command

Reimplemented from itk::simple::Command.

◆ SetCallbackFunction() [1/4]

void itk::simple::FunctionCommand::SetCallbackFunction ( const std::function< void()> &  )

Set as a C++ function, which is compatible with lambdas.

◆ SetCallbackFunction() [2/4]

template<class T >
void itk::simple::FunctionCommand::SetCallbackFunction ( T *  object,
void(T::*)()  pMemberFunction 
)
inline

Generic method to set a class's member function to be called in the Execute method.

Definition at line 51 of file sitkFunctionCommand.h.

◆ SetCallbackFunction() [3/4]

void itk::simple::FunctionCommand::SetCallbackFunction ( void(*)()  pFunction)

Set a C-Style function to be called in the Execute method

◆ SetCallbackFunction() [4/4]

void itk::simple::FunctionCommand::SetCallbackFunction ( void(*)(void *)  pFunction,
void *  clientData 
)

Set a C-Style function with a void* clientData as an argument. The caller is responsible for managing the life of the clientData and that it's valid when Execute is called with the clientData.

Member Data Documentation

◆ m_Function

FunctionObjectType itk::simple::FunctionCommand::m_Function
private

Definition at line 72 of file sitkFunctionCommand.h.


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