| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
PipeReader Class Reference
Collaboration diagram for PipeReader:
[legend]

## Public Member Functions
| PipeReader (const char *cmd)
| ~PipeReader (void)
std::istringstream & | output (void)

## Private Attributes
FILE * | pipe
std::istringstream * | iss

## Detailed Description

Definition at line 88 of file pfm_gen_analysis.cpp.

## Constructor & Destructor Documentation

PipeReader::PipeReader | ( | const char * | cmd | ) |
| inline

Definition at line 91 of file pfm_gen_analysis.cpp.

{
pipe = popen(cmd, "r");
if(!pipe)
{
printf("Cannot open pipe. Exiting...\n");
exit(1);
}
char buffer[PIPE_BUFFER_LENGTH];
bzero(buffer, PIPE_BUFFER_LENGTH);
std::string result = "";
while(!feof(pipe))
{
if(fgets(buffer, PIPE_BUFFER_LENGTH, pipe)!=NULL)
{
result += buffer;
}
bzero(buffer, PIPE_BUFFER_LENGTH);
}
iss = new std::istringstream(result, std::istringstream::in);
}

PipeReader::~PipeReader | ( | void |  | ) |
| inline

Definition at line 113 of file pfm_gen_analysis.cpp.

{
pclose(pipe);
delete iss;
}

## Member Function Documentation

std::istringstream& PipeReader::output | ( | void |  | ) |
| inline

Definition at line 119 of file pfm_gen_analysis.cpp.

{
return *iss;
}

## Member Data Documentation

std::istringstream* PipeReader::iss
| private

Definition at line 125 of file pfm_gen_analysis.cpp.

FILE* PipeReader::pipe
| private

Definition at line 124 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_v25r0/GaudiProfiling/src/app/pfm_gen_analysis.cpp