VTK  9.7.1
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 #include "vtkDeprecation.h" // For deprecation macro
28 
29 // the old style void fund(void *) callbacks
30 VTK_ABI_NAMESPACE_BEGIN
32  "Legacy command, do not use anymore.") VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand
33  : public vtkCommand
34 {
35 public:
37 
39 
43  void Execute(vtkObject* invoker, unsigned long eid, void* calldata) override;
44 
46 
49  void SetClientData(void* cd) { this->ClientData = cd; }
50  void SetCallback(void (*f)(void* clientdata)) { this->Callback = f; }
51  void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
53 
54  void* ClientData;
55  void (*Callback)(void*);
56  void (*ClientDataDeleteCallback)(void*);
57 
58 protected:
60  ~vtkOldStyleCallbackCommand() override;
61 };
62 
63 VTK_ABI_NAMESPACE_END
64 #endif /* vtkOldStyleCallbackCommand_h */
65 
66 // VTK-HeaderTest-Exclude: vtkOldStyleCallbackCommand.h
virtual void Execute(vtkObject *caller, unsigned long eventId, void *callData)=0
All derived classes of vtkCommand must implement this method.
abstract base class for most VTK objects
Definition: vtkObject.h:52
void SetClientData(void *cd)
Methods to set and get client and callback information.
superclass for callback/observer methods
Definition: vtkCommand.h:384
#define VTK_DEPRECATED_IN_9_6_0(reason)
supports legacy function callbacks for VTK
static vtkOldStyleCallbackCommand * New()
void SetCallback(void(*f)(void *clientdata))
Methods to set and get client and callback information.
void SetClientDataDeleteCallback(void(*f)(void *))
Methods to set and get client and callback information.