VTK
vtkOldStyleCallbackCommand.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOldStyleCallbackCommand.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
34 #ifndef vtkOldStyleCallbackCommand_h
35 #define vtkOldStyleCallbackCommand_h
36 
37 #include "vtkCommonCoreModule.h" // For export macro
38 #include "vtkCommand.h"
39 
40 // the old style void fund(void *) callbacks
41 class VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand : public vtkCommand
42 {
43 public:
45 
47  {return new vtkOldStyleCallbackCommand;};
48 
52  void Execute(vtkObject *invoker,
53  unsigned long eid,
54  void *calldata) VTK_OVERRIDE;
55 
57 
60  void SetClientData(void *cd)
61  {this->ClientData = cd;};
62  void SetCallback(void (*f)(void *clientdata))
63  {this->Callback = f;};
64  void SetClientDataDeleteCallback(void (*f)(void *))
65  {this->ClientDataDeleteCallback = f;};
67 
68  void *ClientData;
69  void (*Callback)(void *);
70  void (*ClientDataDeleteCallback)(void *);
71 
72 protected:
74  ~vtkOldStyleCallbackCommand() VTK_OVERRIDE;
75 };
76 
77 
78 #endif /* vtkOldStyleCallbackCommand_h */
79 
80 // 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:59
void SetClientData(void *cd)
Methods to set and get client and callback information.
superclass for callback/observer methods
Definition: vtkCommand.h:341
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.