summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-02-22 15:30:51 +0000
committerMorgan Deters <mdeters@gmail.com>2012-02-22 15:30:51 +0000
commit4aecb261e60bf3e2de0d6a59af8d3a55b608c273 (patch)
treeac707035fb32f047a690a1d12e4aba0ada5b8d7e /src/expr
parent5113a97006ab1ed6de2eec471b9ad624d14e8d27 (diff)
Fixes to documentation / fixes for MacOS
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/command.cpp4
-rw-r--r--src/expr/command.h11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/expr/command.cpp b/src/expr/command.cpp
index ba29b6c34..8d089901b 100644
--- a/src/expr/command.cpp
+++ b/src/expr/command.cpp
@@ -74,6 +74,10 @@ ostream& operator<<(ostream& out, const CommandStatus* s) throw() {
Command::Command() throw() : d_commandStatus(NULL) {
}
+Command::Command(const Command& cmd) {
+ d_commandStatus = (cmd.d_commandStatus == NULL) ? NULL : &cmd.d_commandStatus->clone();
+}
+
Command::~Command() throw() {
if(d_commandStatus != NULL && d_commandStatus != CommandSuccess::instance()) {
delete d_commandStatus;
diff --git a/src/expr/command.h b/src/expr/command.h
index 2d87fefc2..fa1da4cb1 100644
--- a/src/expr/command.h
+++ b/src/expr/command.h
@@ -158,30 +158,31 @@ public:
virtual ~CommandStatus() throw() {}
void toStream(std::ostream& out,
OutputLanguage language = language::output::LANG_AST) const throw();
+ virtual CommandStatus& clone() const = 0;
};/* class CommandStatus */
class CVC4_PUBLIC CommandSuccess : public CommandStatus {
static const CommandSuccess* s_instance;
public:
static const CommandSuccess* instance() throw() { return s_instance; }
+ CommandStatus& clone() const { return const_cast<CommandSuccess&>(*this); }
};/* class CommandSuccess */
class CVC4_PUBLIC CommandUnsupported : public CommandStatus {
+public:
+ CommandStatus& clone() const { return *new CommandUnsupported(*this); }
};/* class CommandSuccess */
class CVC4_PUBLIC CommandFailure : public CommandStatus {
std::string d_message;
public:
CommandFailure(std::string message) throw() : d_message(message) {}
+ CommandFailure& clone() const { return *new CommandFailure(*this); }
~CommandFailure() throw() {}
std::string getMessage() const throw() { return d_message; }
};/* class CommandFailure */
class CVC4_PUBLIC Command {
- // intentionally not permitted
- Command(const Command&) CVC4_UNDEFINED;
- Command& operator=(const Command&) CVC4_UNDEFINED;
-
protected:
/**
* This field contains a command status if the command has been
@@ -197,6 +198,8 @@ public:
typedef CommandPrintSuccess printsuccess;
Command() throw();
+ Command(const Command& cmd);
+
virtual ~Command() throw();
virtual void invoke(SmtEngine* smtEngine) throw() = 0;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback