The Gaudi Framework  v33r1 (b1225454)
StdArrayAsProperty.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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 #ifndef GAUDIKERNEL_STDARRAYASPROPERTY_H
12 #define GAUDIKERNEL_STDARRAYASPROPERTY_H 1
13 // ============================================================================
14 // Include files
15 // ============================================================================
16 // STD & STL
17 // ============================================================================
18 #include "GaudiKernel/ToStream.h"
19 #include <algorithm>
20 #include <array>
21 // ============================================================================
33 // ============================================================================
35 // ============================================================================
36 namespace Gaudi {
37  // ==========================================================================
38  namespace Parsers {
39  // ========================================================================
47  template <class TYPE, std::size_t N>
48  StatusCode parse( std::array<TYPE, N>& result, const std::string& input ) {
50  StatusCode sc = parse( tmp, input );
51  if ( sc.isFailure() ) return sc; // RETURN
52  if ( N != tmp.size() ) return StatusCode( StatusCode::FAILURE, true );
53  std::copy( tmp.begin(), tmp.end(), result.begin() );
54  return StatusCode::SUCCESS;
55  }
56  // ========================================================================
57  } // namespace Parsers
58  // ==========================================================================
59 } // end of namespace Gaudi
60 // ============================================================================
61 // The END
62 // ============================================================================
63 #endif // GAUDIKERNEL_STDARRAYASPROPERTY_H
T copy(T... args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
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...
STL class.
int N
Definition: IOTest.py:110
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
T size(T... args)
STL class.
T begin(T... args)
STL class.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
bool isFailure() const
Definition: StatusCode.h:145
implementation of various functions for streaming.
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1