Belle II Software release-09-00-01
dataframe< Ts > Struct Template Reference
Inheritance diagram for dataframe< Ts >:
Collaboration 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 617 of file ntuples_full.h.

Member Function Documentation

◆ emplace_back()

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

Definition at line 647 of file ntuples_full.h.

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

◆ get() [1/2]

decltype(auto) get ( )
inline

Definition at line 660 of file ntuples_full.h.

661 {
662 return T1::get(*this);
663 }

◆ get() [2/2]

decltype(auto) get ( ) const
inline

Definition at line 654 of file ntuples_full.h.

655 {
656 return T1::get(*this);
657 }

◆ get_nth_type()

static constexpr auto get_nth_type ( )
inlinestaticconstexpr

Definition at line 672 of file ntuples_full.h.

673 {
674
675 return get_ax_name_container(NthTypeOf<N, _Remove_cvref_t<Ts>...> {});
676 }

◆ operator[]() [1/3]

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

Definition at line 620 of file ntuples_full.h.

621 {
622 return nt::ax_name_container<T2>::get(*this);
623 }

◆ operator[]() [2/3]

auto operator[] ( size_t  i)
inline

Definition at line 625 of file ntuples_full.h.

626 {
627 using ret_t = nt::ntuple<_Remove_cvref_t<Ts> &...>;
628 return ret_t{
629 get<Ts>()[i]... };
630 }

◆ operator[]() [3/3]

auto operator[] ( size_t  i) const
inline

Definition at line 632 of file ntuples_full.h.

633 {
634 using ret_t = nt::ntuple<const Ts& ...>;
635 return ret_t{
636 get<Ts>()[i]... };
637 }

◆ push_back()

void push_back ( const T &  t)
inline

Definition at line 640 of file ntuples_full.h.

641 {
642
643 [](auto...) {}(Ts::get(*this).emplace_back(Ts::get(t))...);
644 }

◆ size()

auto size ( ) const
inline

Definition at line 665 of file ntuples_full.h.

666 {
667 auto size = _Remove_cvref_t<NthTypeOf<0, Ts...>>::get(*this).size();
668 return size;
669 }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 677 of file ntuples_full.h.

678 {
679 out << "|";
680
681 constexpr_for<0, sizeof...(Ts), 1>([&](auto ntuple_index) {
682 static const auto x = self.template get_nth_type<ntuple_index>();
683 out << " ";
684 out << std::setw(5) << x.get_name();
685 out << " |";
686 });
687
688 out << "\n";
689 out << "|";
690 constexpr_for<0, sizeof...(Ts), 1>([&](auto i) {
691 out << std::setw(5) << "-------|";
692 });
693 out << "\n";
694 auto size = self.size();
695 for (int i = 0; i < size; ++i) {
696 auto current_element = self[i];
697 out << "|";
698 constexpr_for<0, sizeof...(Ts), 1>([&](auto ntuple_index) {
699 static const auto x = self.template get_nth_type<ntuple_index>();
700 out << " ";
701 out << std::setw(5) << x.get(current_element).v;
702 out << " |";
703 });
704 out << "\n";
705 }
706
707 return out;
708 }

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