freControllerCollector.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freControllerCollector.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #ifndef __freControllerCollector_h
00023 #define __freControllerCollector_h
00024 
00025 #include "freElementals.h"
00026 #include "freEvents.h"
00027 #include "freSetup.h"
00028 #include "freControllerEvents.h"
00029 #include "freControllerBase.h"
00030 
00031 #include "itkMutexLock.h"
00032 #include "itkDynamicLoader.h"
00033 
00034 namespace FREE
00035 {
00036 
00037 class ControllerCollectorInfo : public itk::Object
00038 {
00039 public:
00040   typedef ControllerCollectorInfo Self;
00041   typedef itk::LightObject        Superclass;
00042         typedef itk::SmartPointer<Self>   Pointer;
00043   typedef itk::SmartPointer<const Self>  ConstPointer;
00044 
00045   itkNewMacro(Self);
00046   itkTypeMacro(ControllerCollectorInfo,itk::LightObject;);
00047 
00048   enum ControllerStatus
00049   {
00050     CSActive = 0,
00051     CSIgnored = 1,
00052     CSOutdated = 2
00053   };
00054 
00055   itkSetMacro(ControllerID,std::string);
00056   itkGetConstReferenceMacro(ControllerID,std::string);
00057 
00058   itkSetMacro(LibraryFile,std::string);
00059   itkGetConstReferenceMacro(LibraryFile,std::string);
00060 
00061   itkSetMacro(ControllerStatus,ControllerStatus);
00062   itkGetConstReferenceMacro(ControllerStatus,ControllerStatus);
00063 
00064 protected:
00065   ControllerCollectorInfo();
00066 
00067   std::string m_ControllerID;
00068   std::string m_LibraryFile;
00069   ControllerStatus m_ControllerStatus;
00070 
00071 private:
00072   ControllerCollectorInfo(const ControllerCollectorInfo& destionation);
00073   ControllerCollectorInfo& operator =(const ControllerCollectorInfo& destionation);
00074 };
00075 
00089 class ControllerCollector : public itk::Object
00090 {
00091 public:
00092   typedef ControllerCollector Self;
00093   typedef itk::Object         Superclass;
00094         typedef itk::SmartPointer<Self>   Pointer;
00095   typedef itk::SmartPointer<const Self>  ConstPointer;
00096 
00097   itkNewMacro(Self);
00098   itkTypeMacro(ControllerCollectorInfo,itk::Object;);
00099 
00100   enum ControllerStatus
00101   {
00102     CSActive = 0,
00103     CSIgnored = 1,
00104     CSOutdated = 2
00105   };
00106 
00107   typedef std::multimap<std::string, ControllerCollectorInfo::Pointer> ControllerListType;
00108 
00110   typedef ControllerCollector Self;
00111 
00113   void Initialize();
00114 
00115   ControllerListType& GetControllerList() {return m_Controllers;} ;
00116   const ControllerListType& GetControllerList() const {return m_Controllers;};
00117 
00121         void SetOnControlEvent(ProgressEventBase* pOnControl);
00122 
00123 protected:
00124    ControllerCollector();
00125 
00126 private:
00127 
00136   bool TriggerControlEvent(const int iStatusID, const std::string& sComment, void* pSender = 0, long threadID = 0);
00137 
00139   void LoadDynamicControllers();
00140 
00142   void LoadLibrariesInPath( const char*);
00143 
00145   ControllerListType m_Controllers; 
00146 
00149         ProgressEventBase::Pointer m_fnOnControl;
00150 
00151   ControllerCollector(const ControllerCollector& destionation);
00152   ControllerCollector& operator =(const ControllerCollector& destionation);
00153 };
00154 
00155 } //end of namespace free;
00156 
00157 #endif

Generated at Sat Oct 13 15:39:55 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000