1 /*=========================================================================
4 Module: $RCSfile: gdcmCallbackCommand.cxx,v $
6 Date: $Date: 2007/09/18 15:59:48 $
7 Version: $Revision: 1.4 $
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"
21 namespace GDCM_NAME_SPACE
23 //-----------------------------------------------------------------------------
24 // Constructor / Destructor
26 * \brief Constructor used when we want to generate dicom files from scratch
28 CallbackCommand::CallbackCommand()
31 CallbackArgDelete = NULL;
36 * \brief Canonical destructor.
38 CallbackCommand::~CallbackCommand ()
40 // SetCallback(NULL,NULL,NULL);
43 //-----------------------------------------------------------------------------
46 * \brief Set the callback method
47 * @param callback Method to call
48 * @param arg Argument to pass to the method
49 * \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 callback 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 callback 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