ATLAS Offline Software
Loading...
Searching...
No Matches
Prompt::SortObjectByVar Struct Reference

#include <PromptUtils.h>

Collaboration diagram for Prompt::SortObjectByVar:

Public Member Functions

 SortObjectByVar (const unsigned v, MsgStream &m, bool inverse=false)
template<class T>
bool operator() (const T &lhs, const T &rhs)

Private Member Functions

 SortObjectByVar ()

Private Attributes

unsigned m_var
bool m_inv
MsgStream & m_msg

Detailed Description

Definition at line 116 of file PromptUtils.h.

Constructor & Destructor Documentation

◆ SortObjectByVar() [1/2]

Prompt::SortObjectByVar::SortObjectByVar ( const unsigned v,
MsgStream & m,
bool inverse = false )
inlineexplicit

Definition at line 118 of file PromptUtils.h.

118:m_var(v), m_inv(inverse), m_msg(m) {}

◆ SortObjectByVar() [2/2]

Prompt::SortObjectByVar::SortObjectByVar ( )
private

Member Function Documentation

◆ operator()()

template<class T>
bool Prompt::SortObjectByVar::operator() ( const T & lhs,
const T & rhs )
inline

Definition at line 120 of file PromptUtils.h.

121 {
122 double val_rhs = 0.0;
123 double val_lhs = 0.0;
124
125 if(!lhs.getVar(m_var, val_lhs) || !rhs.getVar(m_var, val_rhs)) {
126 m_msg << MSG::WARNING << "SortObjectByVar - missing var" << std::endl;
127 }
128
129 if(m_inv) {
130 return val_lhs > val_rhs;
131 }
132
133 return val_lhs < val_rhs;
134 }

Member Data Documentation

◆ m_inv

bool Prompt::SortObjectByVar::m_inv
private

Definition at line 141 of file PromptUtils.h.

◆ m_msg

MsgStream& Prompt::SortObjectByVar::m_msg
private

Definition at line 142 of file PromptUtils.h.

◆ m_var

unsigned Prompt::SortObjectByVar::m_var
private

Definition at line 140 of file PromptUtils.h.


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