Nektar++
Public Member Functions | Private Attributes | List of all members
Nektar::PushBackFunctor< T > Struct Template Reference

Helper functors for holding a vector of numbers to be parsed by boost::spirit. More...

Public Member Functions

 PushBackFunctor (std::vector< T > &in)
 
void operator() (T num) const
 Pushes back values onto m_vec as given by num. More...
 
void operator() (fusion::vector< T, T > num) const
 Pushes back values onto m_vec between the range supplied by num. Valid for only integer types. More...
 

Private Attributes

std::vector< T > & m_vec
 Storage vector that will hold parsed variables from boost::spirit. More...
 

Detailed Description

template<typename T>
struct Nektar::PushBackFunctor< T >

Helper functors for holding a vector of numbers to be parsed by boost::spirit.

See also
ParseUtils::GenerateSeqVector

Definition at line 55 of file ParseUtils.cpp.

Constructor & Destructor Documentation

◆ PushBackFunctor()

template<typename T >
Nektar::PushBackFunctor< T >::PushBackFunctor ( std::vector< T > &  in)
inline

Definition at line 57 of file ParseUtils.cpp.

57 : m_vec(in)
58 {
59 }
std::vector< T > & m_vec
Storage vector that will hold parsed variables from boost::spirit.
Definition: ParseUtils.cpp:84

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
void Nektar::PushBackFunctor< T >::operator() ( fusion::vector< T, T >  num) const
inline

Pushes back values onto m_vec between the range supplied by num. Valid for only integer types.

Definition at line 73 of file ParseUtils.cpp.

74 {
75 static_assert(std::is_integral<T>::value, "Integer type required.");
76 for (T i = fusion::at_c<0>(num); i <= fusion::at_c<1>(num); ++i)
77 {
78 m_vec.push_back(i);
79 }
80 }

References Nektar::PushBackFunctor< T >::m_vec.

◆ operator()() [2/2]

template<typename T >
void Nektar::PushBackFunctor< T >::operator() ( num) const
inline

Pushes back values onto m_vec as given by num.

Definition at line 64 of file ParseUtils.cpp.

65 {
66 m_vec.push_back(num);
67 }

References Nektar::PushBackFunctor< T >::m_vec.

Member Data Documentation

◆ m_vec

template<typename T >
std::vector<T>& Nektar::PushBackFunctor< T >::m_vec
private

Storage vector that will hold parsed variables from boost::spirit.

Definition at line 84 of file ParseUtils.cpp.

Referenced by Nektar::PushBackFunctor< T >::operator()().