fs.mitm: Fix c++ modernization breaking changes

This commit is contained in:
Michael Scire 2018-06-27 23:02:06 -06:00
parent ba805d2c8a
commit 3f7c9fc70d

View File

@ -14,7 +14,11 @@ class DomainOwner {
private: private:
std::array<std::shared_ptr<IServiceObject>, DOMAIN_ID_MAX> domain_objects; std::array<std::shared_ptr<IServiceObject>, DOMAIN_ID_MAX> domain_objects;
public: public:
DomainOwner() = default; DomainOwner() {
for (unsigned int i = 0; i < DOMAIN_ID_MAX; i++) {
this->domain_objects[i].reset();
}
}
/* Shared ptrs should auto delete here. */ /* Shared ptrs should auto delete here. */
virtual ~DomainOwner() = default; virtual ~DomainOwner() = default;
@ -33,14 +37,14 @@ class DomainOwner {
} }
*out_i = std::distance(domain_objects.begin(), object_it); *out_i = std::distance(domain_objects.begin(), object_it);
*object_it = std::move(object); *object_it = object;
(*object_it)->set_owner(this); object->set_owner(this);
return 0; return 0;
} }
Result set_object(std::shared_ptr<IServiceObject> object, unsigned int i) { Result set_object(std::shared_ptr<IServiceObject> object, unsigned int i) {
if (domain_objects[i] == NULL) { if (domain_objects[i] == nullptr) {
domain_objects[i] = std::move(object); domain_objects[i] = object;
object->set_owner(this); object->set_owner(this);
return 0; return 0;
} }