The Gaudi Framework  v32r2 (46d42edc)
details Namespace Reference

Classes

struct  arg_helper
 
struct  arg_helper< Ret(T::*)(Arg) const >
 
class  GenericDataStoreAgent
 
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 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

◆ argument_t

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

Definition at line 33 of file EventIDBase.h.

◆ Converter_t

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

Definition at line 19 of file DataObjectHandle.h.

◆ Payload_t

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

Definition at line 73 of file DataObjectHandle.h.

Function Documentation

◆ add_deref()

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

Definition at line 36 of file EventIDBase.h.

36  {
37  return compose( f, [=]( auto*... p ) { return f( *p... ); } );
38  }
auto compose(lambda_ts &&... lambdas)
Definition: compose.h:36

◆ begin()

template<typename T >
auto details::begin ( reverse_wrapper< T > &  w)

Definition at line 37 of file reverse.h.

37  {
38  using std::rbegin;
39  return rbegin( w.iterable );
40  }

◆ end()

template<typename T >
auto details::end ( reverse_wrapper< T > &  w)

Definition at line 42 of file reverse.h.

42  {
43  using std::rend;
44  return rend( w.iterable );
45  }

◆ make_cmp()

template<typename Proj , typename Cmp = std::greater<>>
auto details::make_cmp ( Proj  p,
Cmp  cmp = {} 
)

Definition at line 41 of file EventIDBase.h.

41  {} ) {
42  static_assert( std::is_reference_v<argument_t<Proj>>, "must be a reference" );
43  static_assert( std::is_const_v<std::remove_reference_t<argument_t<Proj>>>, "must be const" );
44  return [=]( argument_t<Proj> lhs, argument_t<Proj> rhs ) { return cmp( p( lhs ), p( rhs ) ); };
45  }

◆ make_range()

template<typename Range , typename StorageType >
Range details::make_range ( const DataObject obj)

Definition at line 22 of file DataObjectHandle.h.

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

◆ nonConst()

template<class T >
std::remove_const_t<T>* details::nonConst ( T *  p)

Cast a pointer to a non const type.

Definition at line 20 of file GaudiHandle.h.

20  {
21  return const_cast<std::remove_const_t<T>*>( p );
22  }

◆ select_range_converter()

template<typename ValueType , typename Range = Gaudi::Range_<typename ValueType::ConstVector>>
Converter_t<Range> details::select_range_converter ( const DataObject obj)

Definition at line 36 of file DataObjectHandle.h.

36  {
37  using Selection = typename ValueType::Selection;
38  auto sel = dynamic_cast<const Selection*>( obj );
39  if ( sel ) return &make_range<Range, typename ValueType::Selection>;
40  auto con = dynamic_cast<std::add_const_t<typename ValueType::Container>*>( obj );
41  if ( con ) return &make_range<Range, typename ValueType::Container>;
42  return nullptr;
43  }
sel
Definition: IOTest.py:94

◆ size()

template<typename T , typename... Args>
constexpr auto details::size ( const T &  ,
Args &&  ... 
)
noexcept

Definition at line 14 of file AnyDataWrapper.h.

14  {
15  static_assert( sizeof...( Args ) == 0, "No extra args please" );
16  return std::nullopt;
17  }

◆ verifyType()

template<typename T >
bool details::verifyType ( const DataObject dataObj)

Definition at line 46 of file DataObjectHandle.h.

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