| The Gaudi Framework v32r1 (f65d50dc)

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::PipeReader | ( | const char * | cmd | ) |
| inline

Definition at line 91 of file pfm_gen_analysis.cpp.

91 {
92 pipe = popen( cmd, "r" );
93 if ( !pipe ) {
94 printf( "Cannot open pipe. Exiting...\n" );
95 exit( 1 );
96 }
97 char buffer[PIPE_BUFFER_LENGTH];
98 bzero( buffer, PIPE_BUFFER_LENGTH );
99 std::string result = "";
100 while ( !feof( pipe ) ) {
101 if ( fgets( buffer, PIPE_BUFFER_LENGTH, pipe ) != NULL ) { result += buffer; }
102 bzero( buffer, PIPE_BUFFER_LENGTH );
103 }
104 iss = new std::istringstream( result, std::istringstream::in );
105 }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:116
std::istringstream
STL class.
std::fgets
T fgets(T... args)
PipeReader::pipe
FILE * pipe
Definition: pfm_gen_analysis.cpp:115
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::~PipeReader | ( | void |  | ) |
| inline

Definition at line 107 of file pfm_gen_analysis.cpp.

107 {
108 pclose( pipe );
109 delete iss;
110 }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:116
PipeReader::pipe
FILE * pipe
Definition: pfm_gen_analysis.cpp:115

## Member Function Documentation

## ◆ output()

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

Definition at line 112 of file pfm_gen_analysis.cpp.

112 { return *iss; }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:116

## Member Data Documentation

## ◆ iss

std::istringstream* PipeReader::iss
| private

Definition at line 116 of file pfm_gen_analysis.cpp.

## ◆ pipe

FILE* PipeReader::pipe
| private

Definition at line 115 of file pfm_gen_analysis.cpp.

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

- GaudiProfiling/src/app/pfm_gen_analysis.cpp