freSetupOptimizationMultiThreadMetricControllerBase.txx

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: freSetupOptimizationMultiThreadMetricControllerBase.txx,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 __freSetupOptimizationMultiThreadMetricControllerBase_txx
00023 #define __freSetupOptimizationMultiThreadMetricControllerBase_txx
00024 
00025 #include "freSetupOptimizationMultiThreadMetricControllerBase.h"
00026 #include "freExceptions.h"
00027 
00028 namespace FREE
00029 {
00030 
00034 
00035 template <class TControlledMetric>
00036 const char* const SetupOptimizationMultiThreadMetricControllerBase<TControlledMetric>::cParam_NrOfThreads = "NrOfThreads";
00037 template <class TControlledMetric>
00038 const char* const SetupOptimizationMultiThreadMetricControllerBase<TControlledMetric>::cParamDsc_NrOfThreads = "Number of threads that will be used to compute the metric measure.";
00039   
00040 template <class TControlledMetric>
00041 SetupOptimizationMultiThreadMetricControllerBase<TControlledMetric>::
00042 SetupOptimizationMultiThreadMetricControllerBase()
00043 {
00044         //Profile settings
00045         this->UpdateControllerID(ControllerID::SetupOptimizationMultiThreadMetricControllerBase);
00046         this->m_Description = "Base class for a multi threading metric.";
00047 };
00048 
00049 template <class TControlledMetric>
00050 void
00051 SetupOptimizationMultiThreadMetricControllerBase<TControlledMetric>::
00052 GenerateProfile(CtrlProfile::ControllerProfile& profile,
00053                   const SessionComponentCache* pComponentCache,
00054                   bool bRegardOldSetup) const
00055 {
00056   Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00057 
00058         //Parameters
00059         profile.Parameters().AddParameter(cParam_NrOfThreads,CtrlProfile::Parameter::PVTULong,cParamDsc_NrOfThreads,1,"1");
00060 };
00061 
00062 template <class TControlledMetric>
00063 void
00064 SetupOptimizationMultiThreadMetricControllerBase<TControlledMetric>::
00065 ActualizeMainComponent(ComponentType* pMainComponent,
00066                                       SessionComponentCache* pComponentCache,
00067                                       SessionInfo* pSessionInfo,
00068                                                                                                                                                         const unsigned int& iActLevel) const
00069 {
00070         Superclass::ActualizeMainComponent(pMainComponent, pComponentCache,
00071                                                                                                                                                  pSessionInfo, iActLevel);
00072 
00073         long lThreadNr;
00074   try
00075   {
00076     SessionAccessor::GetParameterValue(pComponentCache,cParam_NrOfThreads,lThreadNr);
00077   }
00078   catchAllNPassMacro("Error while retrieving parameter values.");    
00079 
00080         pMainComponent->SetNumberOfThreads(lThreadNr);
00081 };
00082   
00083 
00084 } //end of namespace free
00085 
00086 
00087 #endif

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