Belle II Software development
dataframe< Ts > Struct Template Reference
Inheritance diagram for dataframe< Ts >:

Public Member Functions

template<typename T2 >
decltype(auto) operator[] (const nt::ax_name_container< T2 > &t)
 
auto operator[] (size_t i)
 
auto operator[] (size_t i) const
 
template<typename T >
void push_back (const T &t)
 
template<typename... T>
void emplace_back (T &&...t)
 
template<typename T1 >
decltype(auto) get () const
 
template<typename T1 >
decltype(auto) get ()
 
auto size () const
 

Static Public Member Functions

template<int N>
static constexpr auto get_nth_type ()
 

Friends

std::ostream & operator<< (std::ostream &out, const dataframe &self)
 

Detailed Description

template<typename... Ts>
struct nt::dataframe< Ts >

Definition at line 517 of file ntuples_full.h.

Member Function Documentation

◆ emplace_back()

void emplace_back ( T &&...  t)
inline

Definition at line 547 of file ntuples_full.h.

548 {
549 static_assert(sizeof...(t) == sizeof...(Ts), "\n==============missmatched amount of arguments=================\n");
550 [](auto...) {}(T::get(*this).emplace_back(std::forward<T>(t))...);
551 }

◆ get() [1/2]

decltype(auto) get ( )
inline

Definition at line 560 of file ntuples_full.h.

561 {
562 return T1::get(*this);
563 }

◆ get() [2/2]

decltype(auto) get ( ) const
inline

Definition at line 554 of file ntuples_full.h.

555 {
556 return T1::get(*this);
557 }

◆ get_nth_type()

static constexpr auto get_nth_type ( )
inlinestaticconstexpr

Definition at line 572 of file ntuples_full.h.

573 {
574
575 return get_ax_name_container(NthTypeOf<N, _Remove_cvref_t<Ts>...> {});
576 }

◆ operator[]() [1/3]

decltype(auto) operator[] ( const nt::ax_name_container< T2 > &  t)
inline

Definition at line 520 of file ntuples_full.h.

521 {
522 return nt::ax_name_container<T2>::get(*this);
523 }

◆ operator[]() [2/3]

auto operator[] ( size_t  i)
inline

Definition at line 525 of file ntuples_full.h.

526 {
527 using ret_t = nt::ntuple<_Remove_cvref_t<Ts> &...>;
528 return ret_t{
529 get<Ts>()[i]...};
530 }

◆ operator[]() [3/3]

auto operator[] ( size_t  i) const
inline

Definition at line 532 of file ntuples_full.h.

533 {
534 using ret_t = nt::ntuple<const Ts& ...>;
535 return ret_t{
536 get<Ts>()[i]...};
537 }

◆ push_back()

void push_back ( const T &  t)
inline

Definition at line 540 of file ntuples_full.h.

541 {
542
543 [](auto...) {}(Ts::get(*this).emplace_back(Ts::get(t))...);
544 }

◆ size()

auto size ( ) const
inline

Definition at line 565 of file ntuples_full.h.

566 {
567 auto size = _Remove_cvref_t<NthTypeOf<0, Ts...>>::get(*this).size();
568 return size;
569 }

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const dataframe< Ts > &  self 
)
friend

Definition at line 577 of file ntuples_full.h.

578 {
579 out << "|";
580
581 constexpr_for<0, sizeof...(Ts), 1>([&](auto ntuple_index) {
582 static const auto x = self.template get_nth_type<ntuple_index>();
583 out << " ";
584 out << std::setw(5) << x.get_name();
585 out << " |";
586 });
587
588 out << "\n";
589 out << "|";
590 constexpr_for<0, sizeof...(Ts), 1>([&](auto i) {
591 out << std::setw(5) << "-------|";
592 });
593 out << "\n";
594 auto size = self.size();
595 for (int i = 0; i < size; ++i) {
596 auto current_element = self[i];
597 out << "|";
598 constexpr_for<0, sizeof...(Ts), 1>([&](auto ntuple_index) {
599 static const auto x = self.template get_nth_type<ntuple_index>();
600 out << " ";
601 out << std::setw(5) << x.get(current_element).v;
602 out << " |";
603 });
604 out << "\n";
605 }
606
607 return out;
608 }

The documentation for this struct was generated from the following file: