The Gaudi Framework  v30r3 (a5ef0a68)
details Namespace Reference

Classes

struct  arg_helper
 
struct  arg_helper< Ret(T::*)(Arg) const >
 
struct  Payload_helper
 
struct  Payload_helper< Gaudi::Range_< T > >
 
struct  reverse_wrapper
 

Typedefs

template<typename T >
using Converter_t = T(*)(const DataObject *)
 
template<typename T >
using Payload_t = typename Payload_helper< T >::type
 
template<typename lambda >
using argument_t = typename arg_helper< lambda >::type
 

Functions

template<typename C >
constexpr auto size (const C &c) noexcept(noexcept(c.size())) -> decltype(c.size())
 
template<typename T , std::size_t N>
constexpr auto size (const T(&array)[N]) noexcept
 
template<typename T , typename... Args>
constexpr auto size (const T &, Args &&...) noexcept
 
template<typename Range , typename StorageType >
Range make_range (const DataObject *obj)
 
template<typename ValueType , typename Range = Gaudi::Range_<typename ValueType::ConstVector>>
Converter_t< Range > select_range_converter (const DataObject *obj)
 
template<typename T >
bool verifyType (const DataObject *dataObj)
 
template<typename Fun >
auto add_deref (Fun f)
 
template<typename Proj , typename Cmp = std::greater<>>
auto make_cmp (Proj p, Cmp cmp={})
 
template<class T >
std::remove_const_t< T > * nonConst (T *p)
 Cast a pointer to a non const type. More...
 
template<typename T >
auto begin (reverse_wrapper< T > &w)
 
template<typename T >
auto end (reverse_wrapper< T > &w)
 

Typedef Documentation

template<typename lambda >
using details::argument_t = typedef typename arg_helper<lambda>::type

Definition at line 35 of file EventIDBase.h.

template<typename T >
using details::Converter_t = typedef T ( * )( const DataObject* )

Definition at line 19 of file DataObjectHandle.h.

template<typename T >
using details::Payload_t = typedef typename Payload_helper<T>::type

Definition at line 75 of file DataObjectHandle.h.

Function Documentation

template<typename Fun >
auto details::add_deref ( Fun  f)

Definition at line 38 of file EventIDBase.h.

39  {
40  return compose( f, [=]( auto*... p ) { return f( *p... ); } );
41  }
auto compose(lambda_ts &&...lambdas)
Definition: compose.h:77
template<typename T >
auto details::begin ( reverse_wrapper< T > &  w)

Definition at line 38 of file reverse.h.

39  {
40  using std::rbegin;
41  return rbegin( w.iterable );
42  }
template<typename T >
auto details::end ( reverse_wrapper< T > &  w)

Definition at line 44 of file reverse.h.

45  {
46  using std::rend;
47  return rend( w.iterable );
48  }
template<typename Proj , typename Cmp = std::greater<>>
auto details::make_cmp ( Proj  p,
Cmp  cmp = {} 
)

Definition at line 44 of file EventIDBase.h.

44  {} )
45  {
46  static_assert( std::is_reference<argument_t<Proj>>::value, "must be a reference" );
47  static_assert( std::is_const<std::remove_reference_t<argument_t<Proj>>>::value, "must be const" );
48  return [=]( argument_t<Proj> lhs, argument_t<Proj> rhs ) { return cmp( p( lhs ), p( rhs ) ); };
49  }
template<typename Range , typename StorageType >
Range details::make_range ( const DataObject obj)

Definition at line 22 of file DataObjectHandle.h.

23  {
24  auto c = static_cast<const StorageType*>( obj );
25  if ( UNLIKELY( !c ) ) return Range();
26  using std::begin;
27  using std::end;
28  auto first = begin( *c );
29  auto last = end( *c );
30  // return Range( first, last );
31  auto _first = reinterpret_cast<typename Range::const_iterator*>( &first );
32  auto _last = reinterpret_cast<typename Range::const_iterator*>( &last );
33  return Range( *_first, *_last );
34  }
#define UNLIKELY(x)
Definition: Kernel.h:122
T end(T...args)
T begin(T...args)
AttribStringParser::Iterator begin(const AttribStringParser &parser)
template<class T >
std::remove_const_t<T>* details::nonConst ( T *  p)

Cast a pointer to a non const type.

Definition at line 21 of file GaudiHandle.h.

22  {
23  return const_cast<std::remove_const_t<T>*>( p );
24  }
template<typename ValueType , typename Range = Gaudi::Range_<typename ValueType::ConstVector>>
Converter_t<Range> details::select_range_converter ( const DataObject obj)

Definition at line 37 of file DataObjectHandle.h.

38  {
39  using Selection = typename ValueType::Selection;
40  auto sel = dynamic_cast<const Selection*>( obj );
41  if ( sel ) return &make_range<Range, typename ValueType::Selection>;
42  auto con = dynamic_cast<std::add_const_t<typename ValueType::Container>*>( obj );
43  if ( con ) return &make_range<Range, typename ValueType::Container>;
44  return nullptr;
45  }
sel
Definition: IOTest.py:95
template<typename C >
constexpr auto details::size ( const C &  c) -> decltype( c.size() )
noexcept

Definition at line 14 of file AnyDataWrapper.h.

15  {
16  return c.size();
17  }
template<typename T , std::size_t N>
constexpr auto details::size ( const T(&)  array[N])
noexcept

Definition at line 20 of file AnyDataWrapper.h.

21  {
22  return N;
23  }
int N
Definition: IOTest.py:101
template<typename T , typename... Args>
constexpr auto details::size ( const T &  ,
Args &&  ... 
)
noexcept

Definition at line 29 of file AnyDataWrapper.h.

30  {
31  static_assert( sizeof...( Args ) == 0, "No extra args please" );
32  return boost::none;
33  }
template<typename T >
bool details::verifyType ( const DataObject dataObj)

Definition at line 48 of file DataObjectHandle.h.

49  {
50  using Type = std::add_const_t<T>;
51  assert( dataObj != nullptr );
52  auto obj = dynamic_cast<Type*>( dataObj );
53  bool ok = ( obj != nullptr );
54  if ( !ok ) {
55  const auto* registry = dataObj->registry();
56  throw GaudiException( "The type expected for " + registry->identifier() + " is " +
57  System::typeinfoName( typeid( Type ) ) +
58  " and is different from the one of the object in the store.",
59  "Wrong DataObjectType", StatusCode::FAILURE );
60  }
61  assert( obj == static_cast<Type*>( dataObj ) );
62  return ok;
63  }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
Define general base for Gaudi exception.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:332
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
Type
the list of available types for ntuples
Definition: TupleObj.h:83