lsst.astshim
22.0.1-1-geca5380+dfc68d4d09
|
#include <Channel.h>
Public Member Functions | |
Channel (Stream &stream, std::string const &options="") | |
virtual | ~Channel () |
Channel (Channel const &)=delete | |
Channel (Channel &&)=default | |
Channel & | operator= (Channel const &)=delete |
Channel & | operator= (Channel &&)=default |
std::shared_ptr< Channel > | copy () const |
Return a deep copy of this object. More... | |
bool | getComment () const |
Get Comment: include textual comments in output? More... | |
int | getFull () const |
Get Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose. More... | |
int | getIndent () const |
Get Indent: indentation increment between objects. More... | |
int | getReportLevel () const |
Get ReportLevel: report level. More... | |
bool | getSkip () const |
Get Skip: skip irrelevant data on input? More... | |
bool | getStrict () const |
Get Strict: generate errors instead of warnings? More... | |
std::shared_ptr< Object > | read () |
Read an object from a channel. More... | |
void | setComment (bool skip) |
Set Comment: include textual comments in output? More... | |
void | setFull (int full) |
Set Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose. More... | |
void | setIndent (int indent) |
Set Indent: indentation increment between objects. More... | |
void | setReportLevel (int level) |
void | setSkip (bool skip) |
Set Skip: skip irrelevant data on input? More... | |
void | setStrict (bool strict) |
Set Strict: generate errors instead of warnings? More... | |
KeyMap | warnings () const |
int | write (Object const &object) |
Write an object to a channel. More... | |
![]() | |
virtual | ~Object () |
Object (Object const &object) | |
Copy constructor: make a deep copy. More... | |
Object (Object &&)=default | |
Object & | operator= (Object const &)=delete |
Object & | operator= (Object &&)=default |
bool | operator== (Object const &rhs) const |
bool | operator!= (Object const &rhs) const |
std::shared_ptr< Object > | copy () const |
Return a deep copy of this object. More... | |
void | clear (std::string const &attrib) |
bool | hasAttribute (std::string const &attrib) const |
std::string | getClassName () const |
std::string | getID () const |
Get ID: object identification string that is not copied. More... | |
std::string | getIdent () const |
Get Ident: object identification string that is copied. More... | |
int | getNObject () const |
int | getObjSize () const |
Get ObjSize: the in-memory size of the AST object in bytes. More... | |
int | getRefCount () const |
bool | getUseDefs () const |
Get UseDefs: allow use of default values for Object attributes? More... | |
void | lock (bool wait) |
bool | same (Object const &other) const |
void | setID (std::string const &id) |
Set ID: object identification string that is not copied. More... | |
void | setIdent (std::string const &ident) |
Set Ident: object identification string that is copied. More... | |
void | setUseDefs (bool usedefs) |
Set UseDefs: allow use of default values for Object attributes? More... | |
void | show (std::ostream &os, bool showComments=true) const |
std::string | show (bool showComments=true) const |
bool | test (std::string const &attrib) const |
void | unlock (bool report=false) |
AstObject const * | getRawPtr () const |
AstObject * | getRawPtr () |
Protected Member Functions | |
virtual std::shared_ptr< Object > | copyPolymorphic () const override |
Channel (AstChannel *chan, Stream &stream, bool isFits=false) | |
Channel (AstChannel *chan) | |
![]() | |
Object (AstObject *object) | |
template<typename T , typename AstT > | |
std::shared_ptr< T > | copyImpl () const |
bool | getB (std::string const &attrib) const |
std::string const | getC (std::string const &attrib) const |
double | getD (std::string const &attrib) const |
float | getF (std::string const &attrib) const |
int | getI (std::string const &attrib) const |
long int | getL (std::string const &attrib) const |
void | set (std::string const &setting) |
void | setB (std::string const &attrib, bool value) |
void | setC (std::string const &attrib, std::string const &value) |
void | setD (std::string const &attrib, double value) |
void | setF (std::string const &attrib, float value) |
void | setI (std::string const &attrib, int value) |
void | setL (std::string const &attrib, long int value) |
Friends | |
class | Object |
Additional Inherited Members | |
![]() | |
using | ObjectPtr = std::unique_ptr< AstObject, Deleter > |
unique pointer holding an AST raw pointer More... | |
![]() | |
static std::shared_ptr< Object > | fromString (std::string const &str) |
template<typename Class > | |
static std::shared_ptr< Class > | fromAstObject (AstObject *rawObj, bool copy) |
![]() | |
template<typename ShimT , typename AstT > | |
static std::shared_ptr< ShimT > | makeShim (AstObject *p) |
Channel provides input/output of AST objects.
Writing an Object to a Channel will generate a textual representation of that Object, and reading from a Channel will create a new Object from its textual representation.
Note that a channel cannot be deep-copied because the contained stream cannot be deep-copied
Channel provides the following attributes, in addition to those provided by Object
|
explicit |
Construct a channel that uses a provided Stream
[in] | stream | Stream for channel I/O:
|
[in] | options | Comma-separated list of attribute assignments. |
|
virtual |
|
delete |
|
default |
|
explicitprotected |
|
explicitprotected |
Construct a channel from an AST channel pointer that has its own stream
[in] | chan | AstChannel object |
|
inline |
Return a deep copy of this object.
|
inlineoverrideprotectedvirtual |
Return a deep copy of this object. This is called by copy.
Each subclass must override this method. The standard implementation is:
for example Frame implements this as:
Implements ast::Object.
|
inline |
Get Comment: include textual comments in output?
|
inline |
Get Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose.
|
inline |
Get Indent: indentation increment between objects.
|
inline |
Get ReportLevel: report level.
|
inline |
Get Skip: skip irrelevant data on input?
|
inline |
Get Strict: generate errors instead of warnings?
std::shared_ptr< Object > ast::Channel::read | ( | ) |
Read an object from a channel.
|
inline |
Set Comment: include textual comments in output?
|
inline |
Set Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose.
|
inline |
Set Indent: indentation increment between objects.
|
inline |
Set ReportLevel: report level; an integer in the range [0, 3] where 0 is the most verbose.
std::invalid_argument | if level is not in range [0, 3] |
|
inline |
Set Skip: skip irrelevant data on input?
|
inline |
Set Strict: generate errors instead of warnings?
KeyMap ast::Channel::warnings | ( | ) | const |
Return a KeyMap holding the text of any warnings issued as a result of the previous invocation of read or write.
If no warnings were issued, an empty KeyMap will be returned. Such warnings are non-fatal and will not prevent the read or write operation succeeding. However, the converted object may not be identical to the original object in all respects. Differences which would usually be deemed as insignificant in most usual cases will generate a warning, whereas more significant differences will generate an error.
The " Strict" attribute allows this warning facility to be switched off, so that a fatal error is always reported for any conversion error.
int ast::Channel::write | ( | Object const & | object | ) |
Write an object to a channel.
|
friend |