22#ifndef ASTSHIM_CHANNEL_H
23#define ASTSHIM_CHANNEL_H
74 explicit Channel(
Stream &stream, std::string
const &options =
"");
84 std::shared_ptr<Channel>
copy()
const {
85 throw std::logic_error(
86 "Channel cannot be deep copied because its contained stream cannot be deep copied");
108 std::shared_ptr<Object>
read();
126 if ((level < 0) || (level > 3)) {
127 std::ostringstream os;
128 os <<
"level = " << level <<
" not in range [0, 3]";
129 throw std::invalid_argument(os.str());
131 setI(
"ReportLevel", level);
159 virtual std::shared_ptr<Object>
copyPolymorphic()
const override {
return std::shared_ptr<Object>(); }
170 explicit Channel(AstChannel *chan,
Stream &stream,
bool isFits=
false);
177 explicit Channel(AstChannel *chan);
virtual ~Channel()
Definition: Channel.cc:45
void setIndent(int indent)
Set Indent: indentation increment between objects.
Definition: Channel.h:117
bool getStrict() const
Get Strict: generate errors instead of warnings?
Definition: Channel.h:105
Channel & operator=(Channel const &)=delete
int getFull() const
Get Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose.
Definition: Channel.h:93
Channel & operator=(Channel &&)=default
void setComment(bool skip)
Set Comment: include textual comments in output?
Definition: Channel.h:111
Channel(Channel &&)=default
KeyMap warnings() const
Definition: Channel.cc:67
int getReportLevel() const
Get ReportLevel: report level.
Definition: Channel.h:99
Channel(Stream &stream, std::string const &options="")
Definition: Channel.cc:31
void setStrict(bool strict)
Set Strict: generate errors instead of warnings?
Definition: Channel.h:138
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: Channel.h:159
Channel(Channel const &)=delete
bool getComment() const
Get Comment: include textual comments in output?
Definition: Channel.h:90
void setReportLevel(int level)
Definition: Channel.h:125
void setSkip(bool skip)
Set Skip: skip irrelevant data on input?
Definition: Channel.h:135
std::shared_ptr< Channel > copy() const
Return a deep copy of this object.
Definition: Channel.h:84
bool getSkip() const
Get Skip: skip irrelevant data on input?
Definition: Channel.h:102
int getIndent() const
Get Indent: indentation increment between objects.
Definition: Channel.h:96
std::shared_ptr< Object > read()
Read an object from a channel.
Definition: Channel.cc:52
int write(Object const &object)
Write an object to a channel.
Definition: Channel.cc:61
void setFull(int full)
Set Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose.
Definition: Channel.h:114
void setI(std::string const &attrib, int value)
Definition: Object.h:500
bool getB(std::string const &attrib) const
Definition: Object.h:348
int getI(std::string const &attrib) const
Definition: Object.h:400
void setB(std::string const &attrib, bool value)
Definition: Object.h:452
AST wrapper classes and functions.
Definition: attributes_channel.dox:1