|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
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 #ifdef WIN32 00055 // Disable warning 00056 // C4996: 'std::copy': Function call with parameters that may be unsafe 00057 // The parameters are checked 00058 #pragma warning(push) 00059 #pragma warning(disable:4996) 00060 #endif 00061 std::copy ( tmp.begin() , tmp.end() , result.begin() ) ; 00062 #ifdef WIN32 00063 #pragma warning(pop) 00064 #endif 00065 return StatusCode::SUCCESS ; 00066 } 00067 // ======================================================================== 00068 } // end of namespace Gaudi::Parsers 00069 // ========================================================================== 00070 } // end of namespace Gaudi 00071 // ============================================================================ 00072 namespace Gaudi 00073 { 00074 // ========================================================================== 00075 namespace Utils 00076 { 00077 // ======================================================================== 00078 template <class SCALAR> 00079 std::ostream& toStream ( const SCALAR& , std::ostream& ) ; 00080 // ======================================================================== 00085 template <class SCALAR, unsigned int N> 00086 std::ostream& toStream 00087 ( const ROOT::Math::SVector<SCALAR,N>& obj , std::ostream& s ) 00088 { 00089 s << "( "; 00090 for ( typename ROOT::Math::SVector<SCALAR,N>::const_iterator cur = obj.begin() ; 00091 obj.end() != cur ; ++cur ) 00092 { 00093 if ( obj.begin() != cur ) { s << " , "; } 00094 toStream ( *cur , s ) ; 00095 } 00096 return s << " )"; 00097 } 00098 // ======================================================================== 00099 } // end of namespace Gaudi::Utils 00100 // ========================================================================== 00101 } // end of namespace Gaudi 00102 // ============================================================================ 00103 // The END 00104 // ============================================================================ 00105 #endif // GAUDIKERNEL_GENVCTPARSERS_H 00106 // ============================================================================