Added virtual destructors

release/4.3a0
Frank Dellaert 2018-09-27 00:23:17 -04:00
parent 4ed362dfd4
commit 9c3949f738
2 changed files with 19 additions and 8 deletions

View File

@ -48,14 +48,23 @@ public:
} Category;
Category category;
/// Default constructor
Qualified() :
category(VOID) {
}
/// Construct from name and optional category
Qualified(const std::string& n, Category c = CLASS) :
name_(n), category(c) {
}
/// Construct from scoped name and optional category
Qualified(const std::string& ns1, const std::string& n, Category c = CLASS) :
name_(n), category(c) {
namespaces_.push_back(ns1);
}
/// Construct from doubly scoped name and optional category
Qualified(const std::string& ns1, const std::string& ns2,
const std::string& n, Category c = CLASS) :
name_(n), category(c) {
@ -63,15 +72,14 @@ public:
namespaces_.push_back(ns2);
}
Qualified(const std::string& ns1, const std::string& n, Category c = CLASS) :
name_(n), category(c) {
namespaces_.push_back(ns1);
}
/// Construct from arbitrarily scoped name
Qualified(std::vector<std::string> ns, const std::string& name) :
namespaces_(ns), name_(name), category(CLASS) {
}
// Destructor
virtual ~Qualified() {}
std::string name() const {
return name_;
}

View File

@ -27,21 +27,24 @@ struct ReturnValue {
friend struct ReturnValueGrammar;
/// Constructor
/// Default constructor
ReturnValue() :
isPair(false) {
}
/// Constructor
/// Construct from type
ReturnValue(const ReturnType& type) :
isPair(false), type1(type) {
}
/// Constructor
/// Construct from pair type arguments
ReturnValue(const ReturnType& t1, const ReturnType& t2) :
isPair(true), type1(t1), type2(t2) {
}
/// Destructor
virtual ~ReturnValue() {}
virtual void clear() {
type1.clear();
type2.clear();