1 /*=========================================================================
4 Module: $RCSfile: gdcmCallbackCommand.cxx,v $
6 Date: $Date: 2007/10/25 08:02:38 $
7 Version: $Revision: 1.5 $
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() :
29 Callback(NULL), CallbackArgDelete(NULL), CallbackArg(NULL)
33 // CallbackArgDelete = NULL;
34 // CallbackArg = NULL;
38 * \brief Canonical destructor.
40 CallbackCommand::~CallbackCommand ()
42 // SetCallback(NULL,NULL,NULL);
45 //-----------------------------------------------------------------------------
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
54 /*void CallbackCommand::SetCallback( CallbackCommand::CbkMethod *callback,void *arg )
56 SetCallback(callback,arg,NULL);
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
65 /*void CallbackCommand::SetCallbackArgDelete( CallbackCommand::CbkMethod *callback )
67 CallbackArgDelete = callback;
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
77 /*void CallbackCommand::SetCallback( void(*callback)(void *),
78 void *arg, void(*argDelete)(void *) )
80 if ( CallbackArg && CallbackArgDelete )
82 CallbackArgDelete( CallbackArg );
87 CallbackArgDelete = argDelete;
90 void CallbackCommand::SetCallback(CallbackCommand::CbkMethod *callback)
95 void CallbackCommand::Execute()
101 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
110 //-----------------------------------------------------------------------------
111 } // end namespace gdcm