00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freMetricControllerBase_txx
00023 #define __freMetricControllerBase_txx
00024
00025 #include "freMetricControllerBase.h"
00026
00027 namespace FREE
00028 {
00029
00030
00034
00035
00036 template <class TControlledMetric>
00037 MetricControllerBase<TControlledMetric>::
00038 MetricControllerBase():ComponentControllerBase<TControlledMetric>()
00039 {
00040 this->UpdateControllerID(ControllerID::MetricControllerBase);
00041 this->m_Description = "Base class for metric controller; not for practical use.";
00042 };
00043
00044 template <class TControlledMetric>
00045 Parameter::Pointer
00046 MetricControllerBase<TControlledMetric>::
00047 GetParameter(const SessionComponentCache* pComponentCache,
00048 const std::string& sParameterName) const
00049 {
00050 if (sParameterName == cParam_MetricMinimize)
00051 {
00052 bool bMinimize = true;
00053
00054 CtrlProfile::Parameter::Pointer smpParamInfo = this->GetProfile(pComponentCache)->Parameters().GetElement(cParam_MetricMinimize);
00055 if (smpParamInfo.IsNotNull())
00056 {
00057 smpParamInfo->GetParameterValue(bMinimize);
00058 }
00059
00060 Parameter::Pointer smpParam = Parameter::New(sParameterName);
00061 smpParam->SetParameterValue(bMinimize);
00062 return smpParam;
00063 }
00064
00065 return ComponentControllerBase<TControlledMetric>::GetParameter(pComponentCache,sParameterName);
00066 };
00067
00068 template <class TControlledMetric>
00069 void
00070 MetricControllerBase<TControlledMetric>::
00071 GenerateProfile(CtrlProfile::ControllerProfile& profile,
00072 const SessionComponentCache* pComponentCache,
00073 bool bRegardOldSetup) const
00074 {
00075 Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00076
00077
00078 profile.Parameters().AddParameter(cParam_MetricMinimize,Parameter::PVTBool,cParamDsc_MetricMinimize,1,"true",1,false,0,DAGet);
00079 };
00080
00081 }
00082
00083 #endif