The Gaudi Framework  v31r0 (aeb156f0)
S_module Class Reference
Collaboration diagram for S_module:

Public Member Functions

 S_module ()
 
void clear ()
 
void init (const char *name, const char *architecture, const char *event_name, unsigned int c_mask, unsigned int inv_mask, unsigned int smpl_period)
 
void set_total (unsigned int total)
 
unsigned int get_smpl_period ()
 
unsigned int get_inv_mask ()
 
unsigned int get_c_mask ()
 
std::string get_arch ()
 
std::string get_event ()
 
void add_sample (const char *index, unsigned int value)
 
bool get_max (char *index, unsigned int &value)
 
std::string get_module_name ()
 
unsigned int get_total_num_samples ()
 

Private Attributes

std::map< std::string, unsigned int > samples
 
unsigned int total_num_samples
 
std::string module_name
 
std::string arch
 
std::string event
 
unsigned int cmask
 
unsigned int inv
 
unsigned int sp
 

Detailed Description

Definition at line 767 of file pfm_gen_analysis.cpp.

Constructor & Destructor Documentation

S_module::S_module ( )
inline

Definition at line 779 of file pfm_gen_analysis.cpp.

779 { clear(); }

Member Function Documentation

void S_module::add_sample ( const char *  index,
unsigned int  value 
)
inline

Definition at line 807 of file pfm_gen_analysis.cpp.

807  {
808  samples[index] += value;
809  return;
810  }
std::map< std::string, unsigned int > samples
void S_module::clear ( )
inline

Definition at line 780 of file pfm_gen_analysis.cpp.

780  {
781  samples.clear();
782  total_num_samples = 0;
783  sp = 0;
784  module_name = "";
785  cmask = 0;
786  inv = 0;
787  sp = 0;
788  }
std::string module_name
std::map< std::string, unsigned int > samples
unsigned int cmask
unsigned int total_num_samples
T clear(T...args)
unsigned int inv
std::string S_module::get_arch ( )
inline

Definition at line 805 of file pfm_gen_analysis.cpp.

805 { return arch; }
std::string arch
unsigned int S_module::get_c_mask ( )
inline

Definition at line 804 of file pfm_gen_analysis.cpp.

804 { return cmask; }
unsigned int cmask
std::string S_module::get_event ( )
inline

Definition at line 806 of file pfm_gen_analysis.cpp.

806 { return event; }
std::string event
unsigned int S_module::get_inv_mask ( )
inline

Definition at line 803 of file pfm_gen_analysis.cpp.

803 { return inv; }
unsigned int inv
bool S_module::get_max ( char *  index,
unsigned int &  value 
)
inline

Definition at line 811 of file pfm_gen_analysis.cpp.

811  {
812  auto max_pos = std::max_element( samples.begin(), samples.end(),
813  []( const auto& lhs, const auto& rhs ) { return lhs.second < rhs.second; } );
814  if ( max_pos == samples.end() ) return false;
815  strcpy( index, ( max_pos->first ).c_str() );
816  value = max_pos->second;
817  samples.erase( max_pos );
818  return true;
819  }
std::map< std::string, unsigned int > samples
T max_element(T...args)
T end(T...args)
T erase(T...args)
T strcpy(T...args)
T begin(T...args)
std::string S_module::get_module_name ( )
inline

Definition at line 820 of file pfm_gen_analysis.cpp.

820 { return module_name; }
std::string module_name
unsigned int S_module::get_smpl_period ( )
inline

Definition at line 802 of file pfm_gen_analysis.cpp.

802 { return sp; }
unsigned int sp
unsigned int S_module::get_total_num_samples ( )
inline

Definition at line 821 of file pfm_gen_analysis.cpp.

821 { return total_num_samples; }
unsigned int total_num_samples
void S_module::init ( const char *  name,
const char *  architecture,
const char *  event_name,
unsigned int  c_mask,
unsigned int  inv_mask,
unsigned int  smpl_period 
)
inline

Definition at line 789 of file pfm_gen_analysis.cpp.

790  {
791  module_name = name;
792  arch = architecture;
793  event = event_name;
794  cmask = c_mask;
795  inv = inv_mask;
796  sp = smpl_period;
797  }
std::string module_name
unsigned int cmask
std::string arch
unsigned int inv
void S_module::set_total ( unsigned int  total)
inline

Definition at line 798 of file pfm_gen_analysis.cpp.

798  {
799  total_num_samples = total;
800  return;
801  }
unsigned int total_num_samples

Member Data Documentation

std::string S_module::arch
private

Definition at line 772 of file pfm_gen_analysis.cpp.

unsigned int S_module::cmask
private

Definition at line 774 of file pfm_gen_analysis.cpp.

std::string S_module::event
private

Definition at line 773 of file pfm_gen_analysis.cpp.

unsigned int S_module::inv
private

Definition at line 775 of file pfm_gen_analysis.cpp.

std::string S_module::module_name
private

Definition at line 771 of file pfm_gen_analysis.cpp.

std::map<std::string, unsigned int> S_module::samples
private

Definition at line 769 of file pfm_gen_analysis.cpp.

unsigned int S_module::sp
private

Definition at line 776 of file pfm_gen_analysis.cpp.

unsigned int S_module::total_num_samples
private

Definition at line 770 of file pfm_gen_analysis.cpp.


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