Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SVectorAsProperty.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_GENVCTPARSERS_H
2 #define GAUDIKERNEL_GENVCTPARSERS_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <algorithm>
9 #include <vector>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
14 // ============================================================================
15 // ROOT/SVector
16 // ============================================================================
17 #include "Math/SVector.h"
18 // ============================================================================
29 // ============================================================================
30 namespace Gaudi {
31  // ==========================================================================
32  namespace Parsers {
33  // ========================================================================
41  template <class SCALAR, unsigned int N>
42  StatusCode parse( ROOT::Math::SVector<SCALAR, N>& result, const std::string& input ) {
44  StatusCode sc = parse( tmp, input );
45  if ( sc.isFailure() ) { return sc; } // RETURN
46  if ( N != tmp.size() ) { return StatusCode::FAILURE; } // RETURN
47 #ifdef WIN32
48 // Disable warning
49 // C4996: 'std::copy': Function call with parameters that may be unsafe
50 // The parameters are checked
51 # pragma warning( push )
52 # pragma warning( disable : 4996 )
53 #endif
54  std::copy( tmp.begin(), tmp.end(), result.begin() );
55 #ifdef WIN32
56 # pragma warning( pop )
57 #endif
58  return StatusCode::SUCCESS;
59  }
60  // ========================================================================
61  } // namespace Parsers
62  // ==========================================================================
63 } // end of namespace Gaudi
64 // ============================================================================
65 namespace Gaudi {
66  // ==========================================================================
67  namespace Utils {
68  // ========================================================================
69  template <class SCALAR>
70  std::ostream& toStream( const SCALAR&, std::ostream& );
71  // ========================================================================
76  template <class SCALAR, unsigned int N>
77  std::ostream& toStream( const ROOT::Math::SVector<SCALAR, N>& obj, std::ostream& s ) {
78  s << "( ";
79  for ( auto cur = obj.begin(); obj.end() != cur; ++cur ) {
80  if ( obj.begin() != cur ) { s << " , "; }
81  toStream( *cur, s );
82  }
83  return s << " )";
84  }
85  // ========================================================================
86  } // namespace Utils
87  // ==========================================================================
88 } // end of namespace Gaudi
89 // ============================================================================
90 // The END
91 // ============================================================================
92 #endif // GAUDIKERNEL_GENVCTPARSERS_H
T copy(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
T end(T...args)
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
bool isFailure() const
Definition: StatusCode.h:130
STL class.
int N
Definition: IOTest.py:99
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
T size(T...args)
T begin(T...args)
string s
Definition: gaudirun.py:312
constexpr static const auto FAILURE
Definition: StatusCode.h:86
STL class.
Helper functions to set/get the application return code.
Definition: __init__.py:1