InternalTools.h

Go to the documentation of this file.
00001 // @(#)root/reflex:$Id: InternalTools.h 29288 2009-07-01 13:03:35Z axel $
00002 // Author: Stefan Roiser 2006
00003 
00004 // Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved.
00005 //
00006 // Permission to use, copy, modify, and distribute this software for any
00007 // purpose is hereby granted without fee, provided that this copyright and
00008 // permissions notice appear in all copies and derivatives.
00009 //
00010 // This software is provided "as is" without express or implied warranty.
00011 
00012 
00013 // Include Files
00014 
00015 #ifndef Reflex_InternalTools
00016 #define Reflex_InternalTools
00017 
00018 namespace Reflex {
00019 namespace OTools {
00020 template <typename TO> class ToIter {
00021 public:
00022    template <typename CONT>
00023    static typename std::vector<TO>::iterator
00024    Begin(const CONT& cont) {
00025       return ((typename std::vector<TO> &) const_cast<CONT&>(cont)).begin();
00026    }
00027 
00028 
00029    template <typename CONT>
00030    static typename std::vector<TO>::iterator
00031    End(const CONT& cont) {
00032       return ((typename std::vector<TO> &) const_cast<CONT&>(cont)).end();
00033    }
00034 
00035 
00036    template <typename CONT>
00037    static typename std::vector<TO>::const_reverse_iterator
00038    RBegin(const CONT& cont) {
00039       return ((const typename std::vector<TO> &)cont).rbegin();
00040    }
00041 
00042 
00043    template <typename CONT>
00044    static typename std::vector<TO>::const_reverse_iterator
00045    REnd(const CONT& cont) {
00046       return ((const typename std::vector<TO> &)cont).rend();
00047    }
00048 
00049 
00050 };
00051 
00052 }    // namespace OTools
00053 } // namespace Reflex
00054 
00055 #endif // Reflex_InternalTools

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