1 /*=========================================================================
4 Module: $RCSfile: gdcmCallbackCommand.cxx,v $
6 Date: $Date: 2005/11/29 17:21:33 $
7 Version: $Revision: 1.2 $
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;
36 * \brief Canonical destructor.
38 CallbackCommand::~CallbackCommand ()
40 // SetCallback(NULL,NULL,NULL);
43 //-----------------------------------------------------------------------------
46 * \brief Set the callback method
47 * @param method Method to call
48 * @param arg Argument to pass to the method
49 * \warning In python : the arg parameter isn't considered
51 /*void CallbackCommand::SetCallback( CallbackCommand::CbkMethod *callback,void *arg )
53 SetCallback(callback,arg,NULL);
57 * \brief Set the callback method to delete the argument
58 * The argument is destroyed when the callback method is changed
59 * or when the class is destroyed
60 * @param method Method to call to delete the argument
62 /*void CallbackCommand::SetCallbackArgDelete( CallbackCommand::CbkMethod *callback )
64 CallbackArgDelete = callback;
68 * \brief Set the callback method
69 * @param method Method to call
70 * @param arg Argument to pass to the method
71 * @param argDelete Argument
72 * \warning In python : the arg parameter isn't considered
74 /*void CallbackCommand::SetCallback( void(*callback)(void *),
75 void *arg,void(*argDelete)(void *) )
77 if ( CallbackArg && CallbackArgDelete )
79 CallbackArgDelete( CallbackArg );
84 CallbackArgDelete = argDelete;
87 void CallbackCommand::SetCallback(CallbackCommand::CbkMethod *callback)
92 void CallbackCommand::Execute()
98 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 } // end namespace gdcm