|
Gaudi Framework, version v21r8 |
| Home | Generated: 17 Mar 2010 |
00001 // $Id: $ 00002 // ============================================================================ 00003 #ifndef GAUDIKERNEL_GENVCTPARSERS_H 00004 #define GAUDIKERNEL_GENVCTPARSERS_H 1 00005 // ============================================================================ 00006 // Include files 00007 // ============================================================================ 00008 // STD & STL 00009 // ============================================================================ 00010 #include <vector> 00011 #include <algorithm> 00012 // ============================================================================ 00013 // GaudiKernel 00014 // ============================================================================ 00015 #include "GaudiKernel/Parsers.h" 00016 // ============================================================================ 00017 // ROOT/SVector 00018 // ============================================================================ 00019 #include "Math/SVector.h" 00020 // ============================================================================ 00031 // ============================================================================ 00032 namespace Gaudi 00033 { 00034 // ========================================================================== 00035 namespace Parsers 00036 { 00037 // ======================================================================== 00045 template <class SCALAR, unsigned int N> 00046 StatusCode parse 00047 ( ROOT::Math::SVector<SCALAR,N>& result , 00048 const std::string& input ) 00049 { 00050 std::vector<double> tmp ; 00051 StatusCode sc = parse ( tmp , input ) ; 00052 if ( sc.isFailure() ) { return sc ; } // RETURN 00053 if ( N != tmp.size() ) { return StatusCode::FAILURE ; } // RETURN 00054 std::copy ( tmp.begin() , tmp.end() , result.begin() ) ; 00055 return StatusCode::SUCCESS ; 00056 } 00057 // ======================================================================== 00058 } // end of namespace Gaudi::Parsers 00059 // ========================================================================== 00060 } // end of namespace Gaudi 00061 // ============================================================================ 00062 namespace Gaudi 00063 { 00064 // ========================================================================== 00065 namespace Utils 00066 { 00067 // ======================================================================== 00068 template <class SCALAR> 00069 std::ostream& toStream ( const SCALAR& , std::ostream& ) ; 00070 // ======================================================================== 00075 template <class SCALAR, unsigned int N> 00076 std::ostream& toStream 00077 ( const ROOT::Math::SVector<SCALAR,N>& obj , std::ostream& s ) 00078 { 00079 s << "( "; 00080 for ( typename ROOT::Math::SVector<SCALAR,N>::const_iterator cur = obj.begin() ; 00081 obj.end() != cur ; ++cur ) 00082 { 00083 if ( obj.begin() != cur ) { s << " , "; } 00084 toStream ( *cur , s ) ; 00085 } 00086 return s << " )"; 00087 } 00088 // ======================================================================== 00089 } // end of namespace Gaudi::Utils 00090 // ========================================================================== 00091 } // end of namespace Gaudi 00092 // ============================================================================ 00093 // The END 00094 // ============================================================================ 00095 #endif // GAUDIKERNEL_GENVCTPARSERS_H 00096 // ============================================================================