| The Gaudi Framework v29r0 (ff2e7097)

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

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

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

## Constructor & Destructor Documentation

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

Definition at line 92 of file pfm_gen_analysis.cpp.

93 {
94 pipe = popen( cmd, "r" );
95 if ( !pipe ) {
96 printf( "Cannot open pipe. Exiting...\n" );
97 exit( 1 );
98 }
99 char buffer[PIPE_BUFFER_LENGTH];
100 bzero( buffer, PIPE_BUFFER_LENGTH );
101 std::string result = "";
102 while ( !feof( pipe ) ) {
103 if ( fgets( buffer, PIPE_BUFFER_LENGTH, pipe ) != NULL ) {
104 result += buffer;
105 }
106 bzero( buffer, PIPE_BUFFER_LENGTH );
107 }
108 iss = new std::istringstream( result, std::istringstream::in );
109 }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:121
std::istringstream
STL class.
std::fgets
T fgets(T...args)
PipeReader::pipe
FILE * pipe
Definition: pfm_gen_analysis.cpp:120
std::string
STL class.
std::exit
T exit(T...args)
PIPE_BUFFER_LENGTH
#define PIPE_BUFFER_LENGTH
Definition: pfm_gen_analysis.cpp:87
std::feof
T feof(T...args)
std::printf
T printf(T...args)

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

Definition at line 111 of file pfm_gen_analysis.cpp.

112 {
113 pclose( pipe );
114 delete iss;
115 }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:121
PipeReader::pipe
FILE * pipe
Definition: pfm_gen_analysis.cpp:120

## Member Function Documentation

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

Definition at line 117 of file pfm_gen_analysis.cpp.

117 { return *iss; }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:121

## Member Data Documentation

std::istringstream* PipeReader::iss
| private

Definition at line 121 of file pfm_gen_analysis.cpp.

FILE* PipeReader::pipe
| private

Definition at line 120 of file pfm_gen_analysis.cpp.

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

- GaudiProfiling/src/app/pfm_gen_analysis.cpp