| The Gaudi Framework v32r1 (f65d50dc)

StdArrayAsProperty.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_STDARRAYASPROPERTY_H
2 #define GAUDIKERNEL_STDARRAYASPROPERTY_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include "GaudiKernel/ToStream.h"
9 #include <algorithm>
10 #include <array>
11 // ============================================================================
23 // ============================================================================
24 #include <Gaudi/Parsers/CommonParsers.h>
25 // ============================================================================
26 namespace Gaudi {
27 // ==========================================================================
28 namespace Parsers {
29 // ========================================================================
37 template <class TYPE, std::size_t N>
38 StatusCode parse( std::array<TYPE, N>& result, const std::string& input ) {
39 std::vector<TYPE> tmp;
40 StatusCode sc = parse( tmp, input );
41 if ( sc.isFailure() ) return sc; // RETURN
42 if ( N != tmp.size() ) return StatusCode( StatusCode::FAILURE, true );
43 std::copy( tmp.begin(), tmp.end(), result.begin() );
44 return StatusCode::SUCCESS;
45 }
46 // ========================================================================
47 } // namespace Parsers
48 // ==========================================================================
49 } // end of namespace Gaudi
50 // ============================================================================
51 // The END
52 // ============================================================================
53 #endif // GAUDIKERNEL_STDARRAYASPROPERTY_H
std::copy
T copy(T... args)
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:11
std::vector::end
T end(T... args)
CommonParsers.h
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
std::string
STL class.
IOTest.N
int N
Definition: IOTest.py:99
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::vector::size
T size(T... args)
std::vector
STL class.
std::vector::begin
T begin(T... args)
std::array
STL class.
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
ToStream.h
implementation of various functions for streaming.
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1