SimpleITK  
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:

Detailed Description

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

Definition at line 33 of file sitkFunctionCommand.h.

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...
 
std::string GetName () const override
 
void SetName (const std::string &n) override
 
virtual ~Command () override
 
- Public Member Functions inherited from itk::simple::ObjectOwnedBase
 ObjectOwnedBase ()=default
 
virtual ~ObjectOwnedBase ()=0
 
- Public Member Functions inherited from itk::simple::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 

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 size_t RemoveProcessObject (const itk::simple::ProcessObject *o)
 
- Protected Member Functions inherited from itk::simple::ObjectOwnedBase
virtual size_t AddObjectCallback (itk::Object *o, std::function< void()> onDelete)
 Register an Object and a method to call on this object's destructor. More...
 
 ObjectOwnedBase (const ObjectOwnedBase &o)
 Copy Constructor. More...
 
virtual size_t RemoveObject (const itk::Object *)
 
virtual void SetOwnedByObjects (bool o)
 
virtual bool GetOwnedByObjects () const
 
virtual void OwnedByObjectsOn ()
 
virtual void OwnedByObjectsOff ()
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()=default
 

Member Typedef Documentation

◆ FunctionObjectType

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

Definition at line 73 of file sitkFunctionCommand.h.

◆ Self

Definition at line 36 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 74 of file sitkFunctionCommand.h.


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