A stream for ast::Channel.
More...
#include <Stream.h>
A stream for ast::Channel.
Definition at line 41 of file Stream.h.
◆ Stream() [1/4]
Construct a Stream from input and output std::streams.
- Parameters
-
[in] | istreamPtr | source/input stream; may match ostreamPtr ; may be nullptr if sourcing not needed |
[in] | ostreamPtr | sink/output stream; may match istreamPtr ; may be nullptr if sinking not needed |
Definition at line 51 of file Stream.h.
std::string _sourceStr
string containing a local copy of sourced data, so source can return a char * that won't disappear ri...
std::shared_ptr< std::istream > _istreamPtr
input stream
bool _isFits
is this a FITS stream?
std::shared_ptr< std::ostream > _ostreamPtr
output stream
◆ Stream() [2/4]
◆ ~Stream()
virtual ast::Stream::~Stream |
( |
| ) |
|
|
inlinevirtual |
◆ Stream() [3/4]
ast::Stream::Stream |
( |
Stream const & |
| ) |
|
|
default |
◆ Stream() [4/4]
ast::Stream::Stream |
( |
Stream && |
| ) |
|
|
default |
◆ getIsFits()
bool ast::Stream::getIsFits |
( |
| ) |
const |
|
inline |
get isfits
Definition at line 125 of file Stream.h.
bool _isFits
is this a FITS stream?
◆ hasStdStream()
bool ast::Stream::hasStdStream |
( |
| ) |
|
|
inline |
Return true if this Stream has an input or output std::stream.
Definition at line 73 of file Stream.h.
std::shared_ptr< std::istream > _istreamPtr
input stream
std::shared_ptr< std::ostream > _ostreamPtr
output stream
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setIsFits()
void ast::Stream::setIsFits |
( |
bool |
isFits | ) |
|
|
inlineprotected |
set isFits
Definition at line 129 of file Stream.h.
bool _isFits
is this a FITS stream?
◆ sink()
bool ast::Stream::sink |
( |
char const * |
cstr | ) |
|
|
inline |
Sink (write) to the stream.
- Parameters
-
[in] | cstr | data to write; a newline is then written if _isFits false |
- Returns
- true on success or if there is no stream pointer (a normal mode), false if the stream pointer is in a bad state after writing
- Note
- this function is not virtual because of type slicing: this function is called from code that casts a void pointer to a Stream pointer without knowing which kind of Stream it is.
Definition at line 110 of file Stream.h.
112 (*_ostreamPtr) << cstr;
116 return static_cast<bool>(*_ostreamPtr);
bool _isFits
is this a FITS stream?
std::shared_ptr< std::ostream > _ostreamPtr
output stream
◆ source()
char const* ast::Stream::source |
( |
| ) |
|
|
inline |
Source (read) from the stream.
- Returns
- the data read as a C string, or nullptr if there is no source stream or the source stream is empty or in an error state. The Stream owns the string buffer, and it will be invalidated on the next call to this function.
Definition at line 84 of file Stream.h.
std::string _sourceStr
string containing a local copy of sourced data, so source can return a char * that won't disappear ri...
std::shared_ptr< std::istream > _istreamPtr
input stream
bool _isFits
is this a FITS stream?
◆ Channel
◆ _isFits
bool ast::Stream::_isFits |
|
protected |
is this a FITS stream?
Definition at line 136 of file Stream.h.
◆ _istreamPtr
◆ _ostreamPtr
◆ _sourceStr
string containing a local copy of sourced data, so source can return a char *
that won't disappear right away
Definition at line 135 of file Stream.h.
The documentation for this class was generated from the following file:
- /j/snowflake/release/lsstsw/stack/Linux64/astshim/18.1.0/include/astshim/Stream.h