return NULL;
}
-Attribute* Attribute::build(const Attribute& other)
+Attribute* Attribute::build(Attribute& other)
{
Attribute::Type type = other.getType();
if (type == Attribute::Type::INTEGER) {
- Attribute* dup = new IntegerAttribute(other.getName());
- *dup = other;
+ IntegerAttribute* dup = new IntegerAttribute(other.getName());
+ *dup = static_cast<IntegerAttribute&>(other);
return dup;
} else if (type == Attribute::Type::STRING) {
- Attribute* dup = new StringAttribute(other.getName());
- *dup = other;
+ StringAttribute* dup = new StringAttribute(other.getName());
+ *dup = static_cast<StringAttribute&>(other);
return dup;
}
virtual bool operator<=(const std::string& antecedent) = 0;
static Attribute* build(const std::string& name, Json::Value& jsonNode);
- static Attribute* build(const Attribute& other);
+ static Attribute* build(Attribute& other);
protected:
Attribute(const std::string& name);