Class template for common base class.
More...
#include <pstream.h>
|
typedef std::ios_base::openmode | pmode |
| Type used to specify how to connect to the process. More...
|
|
typedef std::vector< std::string > | argv_type |
| Type used to hold the arguments for a command. More...
|
|
typedef int | fd_type |
| Type used for file descriptors. More...
|
|
static const pmode | pstdin = std::ios_base::out |
| Write to stdin. More...
|
|
static const pmode | pstdout = std::ios_base::in |
| Read from stdout. More...
|
|
static const pmode | pstderr = std::ios_base::app |
| Read from stderr. More...
|
|
static const pmode | newpg = std::ios_base::trunc |
| Create a new process group for the child process. More...
|
|
template<typename CharT, typename Traits = std::char_traits<CharT>>
class redi::pstream_common< CharT, Traits >
Class template for common base class.
Abstract Base Class providing common functionality for basic_ipstream, basic_opstream and basic_pstream. pstream_common manages the basic_pstreambuf stream buffer that is used by the derived classes to initialise an iostream class.
◆ argv_type
template<typename CharT , typename Traits = std::char_traits<CharT>>
◆ ios_type
template<typename CharT , typename Traits = std::char_traits<CharT>>
◆ pmode
template<typename CharT , typename Traits = std::char_traits<CharT>>
◆ streambuf_type
template<typename CharT , typename Traits = std::char_traits<CharT>>
◆ pstream_common() [1/3]
template<typename C , typename T >
Default constructor.
Creates an uninitialised stream.
◆ pstream_common() [2/3]
template<typename C , typename T >
Constructor that initialises the stream by starting a process.
Initialises the stream buffer by calling do_open( command , mode )
- Parameters
-
cmd | a string containing a shell command. |
mode | the I/O mode to use when opening the pipe. |
- See also
- do_open(const std::string&, pmode)
◆ pstream_common() [3/3]
template<typename C , typename T >
Constructor that initialises the stream by starting a process.
Initialises the stream buffer by calling do_open( file , argv , mode )
- Parameters
-
file | a string containing the pathname of a program to execute. |
argv | a vector of argument strings passed to the new program. |
mode | the I/O mode to use when opening the pipe. |
- See also
- do_open(const std::string&, const argv_type&, pmode)
◆ ~pstream_common()
template<typename C , typename T >
|
inlineprotectedpure virtual |
Pure virtual destructor.
This is a pure virtual function to make pstream_common
abstract. Because it is the destructor it will be called by derived classes and so must be defined. It is also protected, to discourage use of the PStreams classes through pointers or references to the base class.
- See also
- If defining a pure virtual seems odd you should read http://www.gotw.ca/gotw/031.htm (and the rest of the site as well!)
◆ close()
template<typename C , typename T >
Close the pipe, returning the program's exit status, as pclose(3) does.
Calls rdbuf->close() and sets failbit
on error. Returns process's exit status, as pclose(3) does.
◆ command()
template<typename C , typename T >
Return the command used to initialise the stream.
- Returns
- a string containing the command used to initialise the stream.
◆ do_open() [1/2]
template<typename C , typename T >
◆ do_open() [2/2]
template<typename C , typename T >
◆ is_open()
template<typename C , typename T >
◆ rdbuf()
template<typename C , typename T >
Return a pointer to the stream buffer.
- Returns
- a pointer to the private stream buffer member.
◆ buf_
template<typename CharT , typename Traits = std::char_traits<CharT>>
◆ command_
template<typename CharT , typename Traits = std::char_traits<CharT>>
The command used to start the process.
The documentation for this class was generated from the following file:
- /home/trekirk/ROS/catkin_dev/src/acoustic_touch_recognition/include/pstreams/pstream.h