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 605 of file ntuples_full.h.

Member Function Documentation

◆ emplace_back()

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

Definition at line 635 of file ntuples_full.h.

636 {
637 static_assert(sizeof...(t) == sizeof...(Ts), "\n==============mismatched amount of arguments=================\n");
638 [](auto...) {}(T::get(*this).emplace_back(std::forward<T>(t))...);
639 }

◆ get() [1/2]

decltype(auto) get ( )
inline

Definition at line 648 of file ntuples_full.h.

649 {
650 return T1::get(*this);
651 }

◆ get() [2/2]

decltype(auto) get ( ) const
inline

Definition at line 642 of file ntuples_full.h.

643 {
644 return T1::get(*this);
645 }

◆ get_nth_type()

static constexpr auto get_nth_type ( )
inlinestaticconstexpr

Definition at line 660 of file ntuples_full.h.

661 {
662
663 return get_ax_name_container(NthTypeOf<N, _Remove_cvref_t<Ts>...> {});
664 }

◆ operator[]() [1/3]

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

Definition at line 608 of file ntuples_full.h.

609 {
610 return nt::ax_name_container<T2>::get(*this);
611 }

◆ operator[]() [2/3]

auto operator[] ( size_t  i)
inline

Definition at line 613 of file ntuples_full.h.

614 {
615 using ret_t = nt::ntuple<_Remove_cvref_t<Ts> &...>;
616 return ret_t{
617 get<Ts>()[i]... };
618 }

◆ operator[]() [3/3]

auto operator[] ( size_t  i) const
inline

Definition at line 620 of file ntuples_full.h.

621 {
622 using ret_t = nt::ntuple<const Ts& ...>;
623 return ret_t{
624 get<Ts>()[i]... };
625 }

◆ push_back()

void push_back ( const T &  t)
inline

Definition at line 628 of file ntuples_full.h.

629 {
630
631 [](auto...) {}(Ts::get(*this).emplace_back(Ts::get(t))...);
632 }

◆ size()

auto size ( ) const
inline

Definition at line 653 of file ntuples_full.h.

654 {
655 auto size = _Remove_cvref_t<NthTypeOf<0, Ts...>>::get(*this).size();
656 return size;
657 }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 665 of file ntuples_full.h.

666 {
667 out << "|";
668
669 constexpr_for<0, sizeof...(Ts), 1>([&](auto ntuple_index) {
670 static const auto x = self.template get_nth_type<ntuple_index>();
671 out << " ";
672 out << std::setw(5) << x.get_name();
673 out << " |";
674 });
675
676 out << "\n";
677 out << "|";
678 constexpr_for<0, sizeof...(Ts), 1>([&](auto i) {
679 out << std::setw(5) << "-------|";
680 });
681 out << "\n";
682 auto size = self.size();
683 for (int i = 0; i < size; ++i) {
684 auto current_element = self[i];
685 out << "|";
686 constexpr_for<0, sizeof...(Ts), 1>([&](auto ntuple_index) {
687 static const auto x = self.template get_nth_type<ntuple_index>();
688 out << " ";
689 out << std::setw(5) << x.get(current_element).v;
690 out << " |";
691 });
692 out << "\n";
693 }
694
695 return out;
696 }

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