00001 /*========================================================================= 00002 00003 Program: gdcm 00004 Module: $RCSfile: gdcmCallbackCommand.cxx,v $ 00005 Language: C++ 00006 Date: $Date: 2007/05/23 14:18:07 $ 00007 Version: $Revision: 1.3 $ 00008 00009 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00010 l'Image). All rights reserved. See Doc/License.txt or 00011 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. 00012 00013 This software is distributed WITHOUT ANY WARRANTY; without even 00014 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00015 PURPOSE. See the above copyright notices for more information. 00016 00017 =========================================================================*/ 00018 // --------------------------------------------------------------- 00019 #include "gdcmCallbackCommand.h" 00020 00021 namespace GDCM_NAME_SPACE 00022 { 00023 //----------------------------------------------------------------------------- 00024 // Constructor / Destructor 00028 CallbackCommand::CallbackCommand() 00029 { 00030 Callback = NULL; 00031 CallbackArgDelete = NULL; 00032 CallbackArg = NULL; 00033 } 00034 00038 CallbackCommand::~CallbackCommand () 00039 { 00040 // SetCallback(NULL,NULL,NULL); 00041 } 00042 00043 //----------------------------------------------------------------------------- 00044 // Public 00051 /*void CallbackCommand::SetCallback( CallbackCommand::CbkMethod *callback,void *arg ) 00052 { 00053 SetCallback(callback,arg,NULL); 00054 }*/ 00055 00062 /*void CallbackCommand::SetCallbackArgDelete( CallbackCommand::CbkMethod *callback ) 00063 { 00064 CallbackArgDelete = callback; 00065 }*/ 00066 00074 /*void CallbackCommand::SetCallback( void(*callback)(void *), 00075 void *arg,void(*argDelete)(void *) ) 00076 { 00077 if ( CallbackArg && CallbackArgDelete ) 00078 { 00079 CallbackArgDelete( CallbackArg ); 00080 } 00081 00082 Callback = callback; 00083 CallbackArg = arg; 00084 CallbackArgDelete = argDelete; 00085 }*/ 00086 00087 void CallbackCommand::SetCallback(CallbackCommand::CbkMethod *callback) 00088 { 00089 Callback=callback; 00090 } 00091 00092 void CallbackCommand::Execute() 00093 { 00094 if(Callback) 00095 Callback(this); 00096 } 00097 00098 //----------------------------------------------------------------------------- 00099 // Protected 00100 00101 //----------------------------------------------------------------------------- 00102 // Private 00103 00104 //----------------------------------------------------------------------------- 00105 // Print 00106 00107 //----------------------------------------------------------------------------- 00108 } // end namespace gdcm