From 1f74e66bb12d9ed9655012301fe660203d0f660e Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 10 Mar 2012 13:37:51 +0000 Subject: Added EntityProperties assignment operator. --- src/entityproperties.cc | 18 ++++++++++++++++++ src/entityproperties.h | 15 +++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'src') diff --git a/src/entityproperties.cc b/src/entityproperties.cc index 88de704..4303b75 100644 --- a/src/entityproperties.cc +++ b/src/entityproperties.cc @@ -19,10 +19,28 @@ EntityProperties::EntityProperties() : } +EntityProperties::EntityProperties(const EntityProperties &other) +{ + assign(other); + +} EntityProperties::~EntityProperties() { } +void EntityProperties::assign(const EntityProperties & other) +{ + properties_radius = other.properties_radius; + + properties_subsections = other.properties_subsections; + properties_type = other.properties_type; + + properties_angles = other.properties_angles; + + properties_template_type = other.properties_template_type; + properties_template_type = other.properties_template_type; +} + void EntityProperties::add_subsection_header(const QString &header, const QString &comment) { if (properties_subsections.size()) { diff --git a/src/entityproperties.h b/src/entityproperties.h index 6fc3d5b..65edbb8 100644 --- a/src/entityproperties.h +++ b/src/entityproperties.h @@ -20,6 +20,8 @@ class EntityProperties : public Properties { public: EntityProperties(); + EntityProperties(const EntityProperties &other); + virtual ~EntityProperties(); /** @@ -82,6 +84,19 @@ public: /* ---- mutators ---- */ + /** + * @brief assignment operator + * */ + void assign(const EntityProperties & other); + + /** + * @brief assignment operator + * */ + inline EntityProperties & operator=(const EntityProperties & other) { + assign(other); + return *this; + } + /** * @brief set the subsection string of this object * */ -- cgit v1.2.3