The Gaudi Framework  master (37c0b60a)
details Namespace Reference

Classes

struct  arg_helper
 
struct  arg_helper< Ret(T::*)(Arg) const >
 
class  GenericDataStoreAgent
 
struct  Payload_helper
 
struct  Payload_helper< Gaudi::DataHandle::Reader, Gaudi::NamedRange_< T >, U >
 
struct  Payload_helper< Gaudi::DataHandle::Reader, Gaudi::Range_< T >, U >
 
struct  Payload_helper< Gaudi::DataHandle::Reader, std::optional< Gaudi::NamedRange_< T > >, U >
 
struct  reverse_wrapper
 

Typedefs

template<typename T >
using Converter_t = T(*)(const DataObject *)
 
template<Gaudi::DataHandle::Mode mode, typename T , typename U = T>
using Payload_t = typename Payload_helper< mode, T, U >::type
 
template<typename T , typename U = T>
using WriteHandle = DataObjectHandle< Payload_t< Gaudi::DataHandle::Writer, T, U > >
 
template<typename T , typename U = T>
using ReadHandle = DataObjectHandle< Payload_t< Gaudi::DataHandle::Reader, T, U > >
 
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 43 of file EventIDBase.h.

◆ Converter_t

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

Definition at line 27 of file DataObjectHandle.h.

◆ Payload_t

template<Gaudi::DataHandle::Mode mode, typename T , typename U = T>
using details::Payload_t = typedef typename Payload_helper<mode, T, U>::type

Definition at line 91 of file DataObjectHandle.h.

◆ ReadHandle

template<typename T , typename U = T>
using details::ReadHandle = typedef DataObjectHandle<Payload_t<Gaudi::DataHandle::Reader, T, U> >

Definition at line 448 of file DataObjectHandle.h.

◆ WriteHandle

template<typename T , typename U = T>
using details::WriteHandle = typedef DataObjectHandle<Payload_t<Gaudi::DataHandle::Writer, T, U> >

Definition at line 446 of file DataObjectHandle.h.

Function Documentation

◆ add_deref()

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

Definition at line 46 of file EventIDBase.h.

46  {
47  return compose( f, [=]( auto*... p ) { return f( *p... ); } );
48  }

◆ begin()

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

Definition at line 47 of file reverse.h.

47  {
48  using std::rbegin;
49  return rbegin( w.iterable );
50  }

◆ end()

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

Definition at line 52 of file reverse.h.

52  {
53  using std::rend;
54  return rend( w.iterable );
55  }

◆ make_cmp()

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

Definition at line 51 of file EventIDBase.h.

51  {} ) {
52  static_assert( std::is_reference_v<argument_t<Proj>>, "must be a reference" );
53  static_assert( std::is_const_v<std::remove_reference_t<argument_t<Proj>>>, "must be const" );
54  return [=]( argument_t<Proj> lhs, argument_t<Proj> rhs ) { return cmp( p( lhs ), p( rhs ) ); };
55  }

◆ make_range()

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

Definition at line 30 of file DataObjectHandle.h.

30  {
31  auto c = static_cast<const StorageType*>( obj );
32  if ( !c ) return Range();
33  using std::begin;
34  using std::end;
35  auto first = begin( *c );
36  auto last = end( *c );
37  auto _first = reinterpret_cast<typename Range::const_iterator*>( &first );
38  auto _last = reinterpret_cast<typename Range::const_iterator*>( &last );
39  return Range( *_first, *_last );
40  }

◆ nonConst()

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

Cast a pointer to a non const type.

Definition at line 29 of file GaudiHandle.h.

29  {
30  return const_cast<std::remove_const_t<T>*>( p );
31  }

◆ 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 43 of file DataObjectHandle.h.

43  {
44  using Selection = typename ValueType::Selection;
45  auto sel = dynamic_cast<const Selection*>( obj );
46  if ( sel ) return &make_range<Range, typename ValueType::Selection>;
47  auto con = dynamic_cast<std::add_const_t<typename ValueType::Container>*>( obj );
48  if ( con ) return &make_range<Range, typename ValueType::Container>;
49  return nullptr;
50  }

◆ size()

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

Definition at line 23 of file AnyDataWrapper.h.

23  {
24  static_assert( sizeof...( Args ) == 0, "No extra args please" );
25  return std::nullopt;
26  }

◆ verifyType()

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

Definition at line 53 of file DataObjectHandle.h.

53  {
54  using Type = std::add_const_t<T>;
55  assert( dataObj != nullptr );
56  auto obj = dynamic_cast<Type*>( dataObj );
57  bool ok = ( obj != nullptr );
58  if ( !ok ) {
59  const auto* registry = dataObj->registry();
60  throw GaudiException( "The type expected for " + registry->identifier() + " is " +
61  System::typeinfoName( typeid( Type ) ) +
62  " and is different from the one of the object in the store which is " +
63  System::typeinfoName( typeid( *dataObj ) ) + ".",
64  "Wrong DataObjectType", StatusCode::FAILURE );
65  }
66  assert( obj == static_cast<Type*>( dataObj ) );
67  return ok;
68  }
cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:83
GaudiException
Definition: GaudiException.h:31
gaudirun.c
c
Definition: gaudirun.py:525
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:315
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:136
GaudiPython.Bindings.nullptr
nullptr
Definition: Bindings.py:87
IOTest.sel
sel
Definition: IOTest.py:106
compose
auto compose(lambda_ts &&... lambdas)
Definition: compose.h:46
std::begin
T begin(T... args)
std::end
T end(T... args)
IOTest.end
end
Definition: IOTest.py:125
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:78