]> Creatis software - gdcm.git/blob - src/gdcmCallbackCommand.h
Fix mistypings
[gdcm.git] / src / gdcmCallbackCommand.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmCallbackCommand.h,v $
5   Language:  C++
6   Date:      $Date: 2007/09/18 15:59:48 $
7   Version:   $Revision: 1.4 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef _GDCMCALLBACKCOMMAND_H_
20 #define _GDCMCALLBACKCOMMAND_H_
21
22 #include "gdcmDebug.h"
23 #include "gdcmCommand.h"
24
25 namespace GDCM_NAME_SPACE 
26 {
27 //-----------------------------------------------------------------------------
28 /**
29  * \brief CallbackCommand base class to react on a gdcm event
30  *
31  * \remarks The execution parameter depends on the
32  */
33 class GDCM_EXPORT CallbackCommand : public Command
34 {
35    gdcmTypeMacro(CallbackCommand);
36    gdcmNewMacro(CallbackCommand);
37
38 public:
39
40    typedef void CbkMethod(CallbackCommand *);
41
42 /*   // Note: the CallbackCommand:: namespace prefix is needed by Swig in the 
43    //       following method declarations. Refer to gdcmPython/gdcm.i
44    //       for the reasons of this unnecessary notation at C++ level.
45    
46    void SetCallback(CallbackCommand::CbkMethod *callback,void *arg = NULL );
47    
48    void SetCallbackArgDelete(CallbackCommand::CbkMethod *callback);
49    
50    // Note: replace CallbackCommand::Method *method to void(*method)(void *) to
51    //       avoid wrapping problems with the typemap conversions
52    
53    void SetCallback(void(*callback)(void *), // CallbackCommand::Method *method
54                     void *arg,
55                     void(*argDelete)(void *));
56 */
57    void SetCallback(CallbackCommand::CbkMethod *callback);
58
59    virtual void Execute();
60
61 protected:
62    CallbackCommand();
63    virtual ~CallbackCommand();
64
65 private:
66    /// pointer to the initialisation method for any progress bar   
67    CbkMethod *Callback;
68    /// pointer to the ??? method for any progress bar   
69    CbkMethod *CallbackArgDelete;
70    /// pointer to the ??? data for any progress bar   
71    void *CallbackArg;
72 };
73 } // end namespace gdcm
74
75 //-----------------------------------------------------------------------------
76 #endif