| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Private Attributes

# PipeReader Class Reference

Collaboration diagram for PipeReader:
[legend]

List of all members.

## 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_v22r2/GaudiProfiling/src/app/pfm_gen_analysis.cpp

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