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: freProcessorControllerBase.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 __freProcessorControllerBase_txx 00023 #define __freProcessorControllerBase_txx 00024 00025 #include "freProcessorControllerBase.h" 00026 #include "freComponentSetupCollection.h" 00027 #include "freSessionAccessor.h" 00028 00029 namespace FREE 00030 { 00034 00035 template <class TControlledProcessor> 00036 ProcessorControllerBase<TControlledProcessor>:: 00037 ProcessorControllerBase() : ComponentControllerBase<TControlledProcessor>() 00038 { 00039 this->UpdateControllerID(ControllerID::ProcessorControllerBase); 00040 this->m_Description = "Base class for processor controller; not for practical use."; 00041 }; 00042 00043 template <class TControlledProcessor> 00044 void 00045 ProcessorControllerBase<TControlledProcessor>:: 00046 CompareValidityTagRequirement(const std::string& mediaID, ValidityTag* pRefTag, SessionComponentCache* pComponentCache) const 00047 { 00048 if (!pRefTag) throwCtrlExceptionMacro("","Error; invalid reference validity tag (NULL pointer) has been passed. Cannot compare validity requirement."); 00049 if (!pComponentCache) throwCtrlExceptionMacro("","Error; invalid component cache (NULL pointer) has been passed. Cannot compare validity requirement."); 00050 00051 ComponentMediaLink::Pointer smpLink = pComponentCache->Setup()->MediaLinks().GetElement(mediaID); 00052 if (smpLink.IsNotNull()) 00053 { 00054 ValidityTag::Pointer smpReq = SessionAccessor::GetValidityTagRequirement(smpLink->GetSourceIDPath(),pComponentCache); 00055 if (pRefTag->IsOutdated(smpReq)) 00056 { //media is newer then reference tag, so adjust reference tag 00057 pRefTag->SetTag(smpReq); 00058 } 00059 } 00060 } 00061 00062 } //end of namespace FREE 00063 00064 #endif
1.5.3 written by Dimitri van Heesch,
© 1997-2000