ContRap-Core
Public Member Functions | Protected Attributes

crp::Console Class Reference

Class Console implements the console stream communication with a process. More...

#include <console.h>

Public Member Functions

 Console ()
 Creates a new console.
 ~Console ()
 Releases memory.
void start (const std::string &command)
 Starts a new console communication by calling a command.
void stop ()
 Terminates the console session.
std::string get_line ()
 Reads a new line.
std::string get_message ()
 Reads from the console till it stops.
bool is_stopped ()
 Returns true if console is stopped.

Protected Attributes

FILE * console
Loggerlogger
 Logger.

Detailed Description

Class Console implements the console stream communication with a process.

A process is started by calling the start() method. The messages written by the process to the standard output can then be obtained one-by-one by calling the get_line() and the get_message() methods.


Constructor & Destructor Documentation

crp::Console::Console ( )

Creates a new console.

crp::Console::~Console ( )

Releases memory.


Member Function Documentation

std::string crp::Console::get_line ( )

Reads a new line.

Returns:
New line from the console
std::string crp::Console::get_message ( )

Reads from the console till it stops.

Returns:
Message by the console
bool crp::Console::is_stopped ( ) [inline]

Returns true if console is stopped.

Returns:
True if console is stopped
void crp::Console::start ( const std::string &  command)

Starts a new console communication by calling a command.

Parameters:
commandCommand to execute
void crp::Console::stop ( )

Terminates the console session.


Field Documentation

FILE* crp::Console::console [protected]

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