VTK  9.3.20230930
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
29 VTK_ABI_NAMESPACE_BEGIN
30 class VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand : public vtkCommand
31 {
32 public:
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 
51  void* ClientData;
52  void (*Callback)(void*);
53  void (*ClientDataDeleteCallback)(void*);
54 
55 protected:
58 };
59 
60 VTK_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:161
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.