freStatisticEntry.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: freStatisticEntry.h,v $
00007   Language:  C++
00008 
00009 
00010   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00011   Institute for Medical Biometry and Informatics, University of Heidelberg,
00012   Germany). All rights reserved.
00013   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00014   for details.
00015 
00016      This software is distributed WITHOUT ANY WARRANTY; without even 
00017      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00018      PURPOSE.  See the above copyright notices for more information.
00019 
00020 =========================================================================*/
00021 #ifndef __freStatisticEntry_h
00022 #define __freStatisticEntry_h
00023 
00024 #include "freTimeStampedObject.h"
00025 #include "freStatisticValue.h"
00026 #include "freStatisticEntryDefinition.h"
00027 
00028 #include "itkLightObject.h"
00029 
00030 namespace FREE
00031 {
00032 freXMLTagMacro(StatisticEntry, "freStat:Entry");
00033 freXMLTagMacro(StatisticEntryRef, "freStat:RefID");
00034 freXMLTagMacro(StatisticEntryID, "freStat:ID");
00035 
00036 /* Forward declaration*/
00037 class StatisticData;
00038 
00048 class StatisticEntry: public TimeStampedObject, public itk::LightObject
00049 {
00050 public:
00051   typedef StatisticEntry  Self;
00052   typedef itk::LightObject Superclass;
00053   typedef itk::SmartPointer<Self>        Pointer;
00054   typedef itk::SmartPointer<const Self>  ConstPointer;
00055 
00056   typedef unsigned long IDType;
00057   static const IDType cUndefinedID;
00058 
00059   itkTypeMacro(StatisticEntry, TimeStampedObject);
00060 
00061   static Pointer New(const IDType& id, clock_t& stampOffset, StatisticData* pData)
00062   {
00063     Pointer smartPtr = new StatisticEntry(id, stampOffset, pData);
00064     smartPtr->UnRegister();
00065 
00066     return smartPtr;
00067   }
00068 
00069   typedef StatisticEntryDefinition::IDType ReferenceIDType;
00070   static const ReferenceIDType cUndefinedRef;
00071 
00072   typedef std::vector<StatisticValue> ValuesType;
00073   typedef std::vector<Pointer> EntriesType;
00074 
00076   StatisticEntry& operator = (const StatisticEntry& entry);
00077 
00082   StatisticEntry::Pointer CreateChildEntry();
00089   StatisticEntry::Pointer PostCreateChildEntry();
00090 
00092   void CloseEntry();
00093 
00094   virtual ~StatisticEntry();
00095 
00097   virtual void Reset();
00098 
00099   void SetID (const IDType& id) {m_ID = id;};
00100   IDType GetID () const { return m_ID; };
00101 
00102   void SetRefID (const ReferenceIDType& id) {m_RefID = id;};
00103   ReferenceIDType GetRefID () const { return m_RefID; };
00104 
00105   const ValuesType& GetValues() const {return m_Values;};
00106   ValuesType& GetValues() {return m_Values;};
00107 
00108   const EntriesType& GetEntries() const {return m_Entries;};
00109   EntriesType& GetEntries() {return m_Entries;};
00110 
00111   StatisticValue& AddValue(const std::string& sValue, const StatisticValue::ReferenceIDType& refID);
00112 
00113 protected:
00115   StatisticEntry(const IDType& id, clock_t& stampOffset, StatisticData* pData);
00116 
00119   IDType m_ID;
00120 
00122   ReferenceIDType m_RefID;
00123 
00126   StatisticData* m_pData;
00127 
00129   ValuesType m_Values;
00130 
00131   EntriesType m_Entries;
00132 
00133   virtual void SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData);
00134   virtual std::string SaveData(const unsigned int& iDepth, bool& bHasSubElements) const;
00135   virtual void AttributesLoadProcessing(const AttributesType& rAttributes);
00136   virtual void SaveAttributes(AttributesSaveListType& rAttributes) const;
00137 };
00138 
00139 } //end of namespace FREE
00140 
00141 #endif

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