]> Creatis software - gdcm.git/blob - src/gdcmCallbackCommand.cxx
Fix mistypings
[gdcm.git] / src / gdcmCallbackCommand.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmCallbackCommand.cxx,v $
5   Language:  C++
6   Date:      $Date: 2007/10/25 08:02:38 $
7   Version:   $Revision: 1.5 $
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 #include "gdcmCallbackCommand.h"
20
21 namespace GDCM_NAME_SPACE 
22 {
23 //-----------------------------------------------------------------------------
24 // Constructor / Destructor
25 /**
26  * \brief Constructor used when we want to generate dicom files from scratch
27  */
28 CallbackCommand::CallbackCommand() :
29    Callback(NULL), CallbackArgDelete(NULL), CallbackArg(NULL)
30    
31 {
32 //   Callback             = NULL;
33 //   CallbackArgDelete    = NULL;
34 //   CallbackArg          = NULL;
35 }
36
37 /**
38  * \brief   Canonical destructor.
39  */
40 CallbackCommand::~CallbackCommand ()
41 {
42 //   SetCallback(NULL,NULL,NULL);
43 }
44
45 //-----------------------------------------------------------------------------
46 // Public
47 /**
48  * \brief   Set the callback method
49  * @param   callback Method to call
50  * @param   arg    Argument to pass to the method
51  * \warning In python : the arg parameter isn't considered
52  */
53  
54 /*void CallbackCommand::SetCallback( CallbackCommand::CbkMethod *callback,void *arg )
55 {
56    SetCallback(callback,arg,NULL);
57 }*/
58
59 /*
60  *\brief   Set the callback method to delete the argument
61  *          The argument is destroyed when the callback method is changed 
62  *          or when the class is destroyed
63  * @param   callback Method to call to delete the argument
64  */
65 /*void CallbackCommand::SetCallbackArgDelete( CallbackCommand::CbkMethod *callback ) 
66 {
67    CallbackArgDelete = callback;
68 }*/
69
70 /*
71  *\brief   Set the callback method
72  * @param   callback Method to call
73  * @param   arg    Argument to pass to the method
74  * @param   argDelete    Argument 
75  * \warning In python : the arg parameter isn't considered
76  */
77 /*void CallbackCommand::SetCallback( void(*callback)(void *),
78                                   void *arg, void(*argDelete)(void *) )
79 {
80    if ( CallbackArg && CallbackArgDelete )
81    {
82       CallbackArgDelete( CallbackArg );
83    }
84
85    Callback          = callback;
86    CallbackArg       = arg;
87    CallbackArgDelete = argDelete;
88 }*/
89
90 void CallbackCommand::SetCallback(CallbackCommand::CbkMethod *callback)
91 {
92    Callback=callback;
93 }
94
95 void CallbackCommand::Execute()
96 {
97    if(Callback)
98       Callback(this);
99 }
100
101 //-----------------------------------------------------------------------------
102 // Protected
103
104 //-----------------------------------------------------------------------------
105 // Private
106
107 //-----------------------------------------------------------------------------
108 // Print
109
110 //-----------------------------------------------------------------------------
111 } // end namespace gdcm