| # Gaudi Framework, version v22r0 |

Home |  | Generated: 9 Feb 2011

# S_module Class Reference

Collaboration diagram for S_module:
[legend]

List of all members.

## 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 723 of file pfm_gen_analysis.cpp.

## Constructor & Destructor Documentation

S_module::S_module | ( |  | ) | `[inline]`

Definition at line 736 of file pfm_gen_analysis.cpp.

    00737   {
    00738    clear();
    00739   }

## Member Function Documentation

void S_module::add_sample | ( | const char * | index,
|  | unsigned int | value |
| ) |  |  | `[inline]`

Definition at line 784 of file pfm_gen_analysis.cpp.

    00785   {
    00786    samples[index] += value;
    00787    return;
    00788   }

void S_module::clear | ( |  | ) | `[inline]`

Definition at line 740 of file pfm_gen_analysis.cpp.

    00741   {
    00742    samples.clear();
    00743    total_num_samples = 0;
    00744    sp = 0;
    00745    module_name = "";
    00746    cmask = 0;
    00747    inv = 0;
    00748    sp = 0;
    00749   }

std::string S_module::get_arch | ( |  | ) | `[inline]`

Definition at line 776 of file pfm_gen_analysis.cpp.

    00777   {
    00778    return arch;
    00779   }

unsigned int S_module::get_c_mask | ( |  | ) | `[inline]`

Definition at line 772 of file pfm_gen_analysis.cpp.

    00773   {
    00774    return cmask;
    00775   }

std::string S_module::get_event | ( |  | ) | `[inline]`

Definition at line 780 of file pfm_gen_analysis.cpp.

    00781   {
    00782    return event;
    00783   }

unsigned int S_module::get_inv_mask | ( |  | ) | `[inline]`

Definition at line 768 of file pfm_gen_analysis.cpp.

    00769   {
    00770    return inv;
    00771   }

bool S_module::get_max | ( | char * | index,
|  | unsigned int * | value |
| ) |  |  | `[inline]`

Definition at line 789 of file pfm_gen_analysis.cpp.

    00790   {
    00791    if(samples.empty()) return false;
    00792    unsigned int cur_max = 0;
    00793    std::map<std::string, unsigned int>::iterator max_pos;
    00794    for(std::map<std::string, unsigned int>::iterator it = samples.begin(); it != samples.end(); ++it)
    00795    {
    00796     if(it->second > cur_max)
    00797     {
    00798      cur_max = it->second;
    00799      max_pos = it;
    00800     }
    00801    }
    00802    strcpy(index, (max_pos->first).c_str());
    00803    *value = max_pos->second;
    00804    samples.erase(max_pos);
    00805    return true;
    00806   }

std::string S_module::get_module_name | ( |  | ) | `[inline]`

Definition at line 807 of file pfm_gen_analysis.cpp.

    00808   {
    00809    return module_name;
    00810   }

unsigned int S_module::get_smpl_period | ( |  | ) | `[inline]`

Definition at line 764 of file pfm_gen_analysis.cpp.

    00765   {
    00766    return sp;
    00767   }

unsigned int S_module::get_total_num_samples | ( |  | ) | `[inline]`

Definition at line 811 of file pfm_gen_analysis.cpp.

    00812   {
    00813    return total_num_samples;
    00814   }

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 750 of file pfm_gen_analysis.cpp.

    00751   {
    00752    module_name = name;
    00753    arch = architecture;
    00754    event = event_name;
    00755    cmask = c_mask;
    00756    inv = inv_mask;
    00757    sp = smpl_period;
    00758   }

void S_module::set_total | ( | unsigned int | total | ) | `[inline]`

Definition at line 759 of file pfm_gen_analysis.cpp.

    00760   {
    00761    total_num_samples = total;
    00762    return;
    00763   }

## Member Data Documentation

std::string S_module::arch`[private]`

Definition at line 729 of file pfm_gen_analysis.cpp.

unsigned int S_module::cmask`[private]`

Definition at line 731 of file pfm_gen_analysis.cpp.

std::string S_module::event`[private]`

Definition at line 730 of file pfm_gen_analysis.cpp.

unsigned int S_module::inv`[private]`

Definition at line 732 of file pfm_gen_analysis.cpp.

std::string S_module::module_name`[private]`

Definition at line 728 of file pfm_gen_analysis.cpp.

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

Definition at line 726 of file pfm_gen_analysis.cpp.

unsigned int S_module::sp`[private]`

Definition at line 733 of file pfm_gen_analysis.cpp.

unsigned int S_module::total_num_samples`[private]`

Definition at line 727 of file pfm_gen_analysis.cpp.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r0/GaudiProfiling/src/app/pfm_gen_analysis.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines