| The Gaudi Framework v27r1

- 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 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.

92 {
93 pipe = popen(cmd, "r");
94 if(!pipe)
95 {
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 {
104 if(fgets(buffer, PIPE_BUFFER_LENGTH, pipe)!=NULL)
105 {
106 result += buffer;
107 }
108 bzero(buffer, PIPE_BUFFER_LENGTH);
109 }
110 iss = new std::istringstream(result, std::istringstream::in);
111 }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:125
std::istringstream
STL class.
std::fgets
T fgets(T...args)
PipeReader::pipe
FILE * pipe
Definition: pfm_gen_analysis.cpp:124
std::string
STL class.
std::exit
T exit(T...args)
PIPE_BUFFER_LENGTH
#define PIPE_BUFFER_LENGTH
Definition: pfm_gen_analysis.cpp:86
std::feof
T feof(T...args)
std::printf
T printf(T...args)

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

Definition at line 113 of file pfm_gen_analysis.cpp.

114 {
115 pclose(pipe);
116 delete iss;
117 }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:125
PipeReader::pipe
FILE * pipe
Definition: pfm_gen_analysis.cpp:124

## Member Function Documentation

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

Definition at line 119 of file pfm_gen_analysis.cpp.

120 {
121 return *iss;
122 }
PipeReader::iss
std::istringstream * iss
Definition: pfm_gen_analysis.cpp:125

## 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:

- GaudiProfiling/src/app/pfm_gen_analysis.cpp