TParameter.h

Go to the documentation of this file.
00001 // @(#)root/base:$Id: TParameter.h 20877 2007-11-19 11:17:07Z rdm $
00002 // Author: Maarten Ballintijn   21/06/2004
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TParameter
00013 #define ROOT_TParameter
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TParameter<AParamType>                                               //
00019 //                                                                      //
00020 // Named parameter, streamable and storable.                            //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 
00025 #ifndef ROOT_TObject
00026 #include "TObject.h"
00027 #endif
00028 
00029 #ifndef ROOT_TString
00030 #include "TString.h"
00031 #endif
00032 
00033 
00034 template <class AParamType>
00035 class TParameter : public TObject {
00036 
00037 private:
00038    TString     fName;
00039    AParamType  fVal;
00040 
00041 public:
00042    TParameter() { /* leave fVal uninitialized */ }
00043    TParameter(const char *name, const AParamType &val)
00044              : fName(name), fVal(val) { }
00045    ~TParameter() { }
00046 
00047    const char       *GetName() const { return fName; }
00048    const AParamType &GetVal() const { return fVal; }
00049    void              SetVal(const AParamType &val) { fVal = val; }
00050 
00051    ClassDef(TParameter,1)  //Named templated parameter type
00052 };
00053 
00054 #endif

Generated on Tue Jul 5 14:10:28 2011 for ROOT_528-00b_version by  doxygen 1.5.1