1 /*=========================================================================
4 Module: $RCSfile: gdcmCallbackCommand.cxx,v $
6 Date: $Date: 2005/11/28 15:20:35 $
7 Version: $Revision: 1.1 $
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.
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.
17 =========================================================================*/
18 // ---------------------------------------------------------------
19 #include "gdcmCallbackCommand.h"
23 //-----------------------------------------------------------------------------
24 // Constructor / Destructor
26 * \brief Constructor used when we want to generate dicom files from scratch
28 CallbackCommand::CallbackCommand()
31 CallbackArgDelete = NULL;
37 * \brief Canonical destructor.
39 CallbackCommand::~CallbackCommand ()
41 // SetCallback(NULL,NULL,NULL);
44 //-----------------------------------------------------------------------------
47 * \brief Set the callback method
48 * @param method Method to call
49 * @param arg Argument to pass to the method
50 * \warning In python : the arg parameter isn't considered
52 /*void CallbackCommand::SetCallback( CallbackCommand::CbkMethod *callback,void *arg )
54 SetCallback(callback,arg,NULL);
58 * \brief Set the callback method to delete the argument
59 * The argument is destroyed when the callback method is changed
60 * or when the class is destroyed
61 * @param method Method to call to delete the argument
63 /*void CallbackCommand::SetCallbackArgDelete( CallbackCommand::CbkMethod *callback )
65 CallbackArgDelete = callback;
69 * \brief Set the callback method
70 * @param method Method to call
71 * @param arg Argument to pass to the method
72 * @param argDelete Argument
73 * \warning In python : the arg parameter isn't considered
75 /*void CallbackCommand::SetCallback( void(*callback)(void *),
76 void *arg,void(*argDelete)(void *) )
78 if ( CallbackArg && CallbackArgDelete )
80 CallbackArgDelete( CallbackArg );
85 CallbackArgDelete = argDelete;
88 void CallbackCommand::SetCallback(CallbackCommand::CbkMethod *callback)
93 void CallbackCommand::Execute()
99 //-----------------------------------------------------------------------------
102 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 } // end namespace gdcm