VTK  9.4.20250102
vtkOldStyleCallbackCommand.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
22#ifndef vtkOldStyleCallbackCommand_h
23#define vtkOldStyleCallbackCommand_h
24
25#include "vtkCommand.h"
26#include "vtkCommonCoreModule.h" // For export macro
27
28// the old style void fund(void *) callbacks
29VTK_ABI_NAMESPACE_BEGIN
30class VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand : public vtkCommand
31{
32public:
34
36
40 void Execute(vtkObject* invoker, unsigned long eid, void* calldata) override;
41
43
46 void SetClientData(void* cd) { this->ClientData = cd; }
47 void SetCallback(void (*f)(void* clientdata)) { this->Callback = f; }
48 void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
50
52 void (*Callback)(void*);
53 void (*ClientDataDeleteCallback)(void*);
54
55protected:
58};
59
60VTK_ABI_NAMESPACE_END
61#endif /* vtkOldStyleCallbackCommand_h */
62
63// VTK-HeaderTest-Exclude: vtkOldStyleCallbackCommand.h
superclass for callback/observer methods
Definition vtkCommand.h:384
abstract base class for most VTK objects
Definition vtkObject.h:162
supports legacy function callbacks for VTK
void SetClientData(void *cd)
Methods to set and get client and callback information.
void Execute(vtkObject *invoker, unsigned long eid, void *calldata) override
Satisfy the superclass API for callbacks.
static vtkOldStyleCallbackCommand * New()
void SetClientDataDeleteCallback(void(*f)(void *))
Methods to set and get client and callback information.
~vtkOldStyleCallbackCommand() override
void SetCallback(void(*f)(void *clientdata))
Methods to set and get client and callback information.