The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
SVectorAsProperty.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
12
14#include <Math/SVector.h>
15#include <algorithm>
16#include <vector>
17
28namespace Gaudi {
29 namespace Parsers {
37 template <class SCALAR, unsigned int N>
38 StatusCode parse( ROOT::Math::SVector<SCALAR, N>& result, std::string_view input ) {
39 std::vector<double> tmp;
40 StatusCode sc = parse( tmp, input );
41 if ( sc.isFailure() ) { return sc; }
42 if ( N != tmp.size() ) { return StatusCode::FAILURE; }
43 std::copy( tmp.begin(), tmp.end(), result.begin() );
45 }
46 } // namespace Parsers
47
48 namespace Utils {
49 template <class SCALAR>
50 std::ostream& toStream( const SCALAR&, std::ostream& );
55 template <class SCALAR, unsigned int N>
56 std::ostream& toStream( const ROOT::Math::SVector<SCALAR, N>& obj, std::ostream& s ) {
57 s << "( ";
58 for ( auto cur = obj.begin(); obj.end() != cur; ++cur ) {
59 if ( obj.begin() != cur ) { s << " , "; }
60 toStream( *cur, s );
61 }
62 return s << " )";
63 }
64 } // namespace Utils
65} // namespace Gaudi
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
bool isFailure() const
Definition StatusCode.h:129
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition ToStream.h:304
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1