Skip to content

Commit

Permalink
Removing deprecated std::auto_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed May 18, 2015
1 parent 42396ad commit 4b995c9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
60 changes: 30 additions & 30 deletions openstudiocore/src/model_editor/projectmodeldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void Project::update() {
}
void Project::del() {
if (typeIsCorrect() == false) {
std::auto_ptr<Project> p(upcastCopy());
std::unique_ptr<Project> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
Expand All @@ -408,17 +408,17 @@ void Project::del() {
bool Project::typeIsCorrect() {
return type == type__;
}
std::auto_ptr<Project> Project::upcast() {
return auto_ptr<Project>(new Project(*this));
std::unique_ptr<Project> Project::upcast() {
return unique_ptr<Project>(new Project(*this));
}
std::auto_ptr<Project> Project::upcastCopy() {
std::unique_ptr<Project> Project::upcastCopy() {
Project* np = new Project(*this);
np->id = id;
np->type = type;
np->name = name;
np->projecttype = projecttype;
np->inDatabase = inDatabase;
return auto_ptr<Project>(np);
return unique_ptr<Project>(np);
}
std::ostream & operator<<(std::ostream& os, Project o) {
os << "-------------------------------------" << std::endl;
Expand Down Expand Up @@ -581,7 +581,7 @@ void Analysis::update() {
}
void Analysis::del() {
if (typeIsCorrect() == false) {
std::auto_ptr<Analysis> p(upcastCopy());
std::unique_ptr<Analysis> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
Expand All @@ -594,17 +594,17 @@ void Analysis::del() {
bool Analysis::typeIsCorrect() {
return type == type__;
}
std::auto_ptr<Analysis> Analysis::upcast() {
return auto_ptr<Analysis>(new Analysis(*this));
std::unique_ptr<Analysis> Analysis::upcast() {
return unique_ptr<Analysis>(new Analysis(*this));
}
std::auto_ptr<Analysis> Analysis::upcastCopy() {
std::unique_ptr<Analysis> Analysis::upcastCopy() {
Analysis* np = new Analysis(*this);
np->id = id;
np->type = type;
np->name = name;
np->analysistype = analysistype;
np->inDatabase = inDatabase;
return auto_ptr<Analysis>(np);
return unique_ptr<Analysis>(np);
}
std::ostream & operator<<(std::ostream& os, Analysis o) {
os << "-------------------------------------" << std::endl;
Expand Down Expand Up @@ -776,7 +776,7 @@ void Model::update() {
}
void Model::del() {
if (typeIsCorrect() == false) {
std::auto_ptr<Model> p(upcastCopy());
std::unique_ptr<Model> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
Expand All @@ -789,18 +789,18 @@ void Model::del() {
bool Model::typeIsCorrect() {
return type == type__;
}
std::auto_ptr<Model> Model::upcast() {
return auto_ptr<Model>(new Model(*this));
std::unique_ptr<Model> Model::upcast() {
return unique_ptr<Model>(new Model(*this));
}
std::auto_ptr<Model> Model::upcastCopy() {
std::unique_ptr<Model> Model::upcastCopy() {
Model* np = new Model(*this);
np->id = id;
np->type = type;
np->name = name;
np->path = path;
np->guid = guid;
np->inDatabase = inDatabase;
return auto_ptr<Model>(np);
return unique_ptr<Model>(np);
}
std::ostream & operator<<(std::ostream& os, Model o) {
os << "-------------------------------------" << std::endl;
Expand Down Expand Up @@ -956,7 +956,7 @@ void Result::update() {
}
void Result::del() {
if (typeIsCorrect() == false) {
std::auto_ptr<Result> p(upcastCopy());
std::unique_ptr<Result> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
Expand All @@ -969,16 +969,16 @@ void Result::del() {
bool Result::typeIsCorrect() {
return type == type__;
}
std::auto_ptr<Result> Result::upcast() {
return auto_ptr<Result>(new Result(*this));
std::unique_ptr<Result> Result::upcast() {
return unique_ptr<Result>(new Result(*this));
}
std::auto_ptr<Result> Result::upcastCopy() {
std::unique_ptr<Result> Result::upcastCopy() {
Result* np = new Result(*this);
np->id = id;
np->type = type;
np->value = value;
np->inDatabase = inDatabase;
return auto_ptr<Result>(np);
return unique_ptr<Result>(np);
}
std::ostream & operator<<(std::ostream& os, Result o) {
os << "-------------------------------------" << std::endl;
Expand Down Expand Up @@ -1131,7 +1131,7 @@ void ResultQuery::update() {
}
void ResultQuery::del() {
if (typeIsCorrect() == false) {
std::auto_ptr<ResultQuery> p(upcastCopy());
std::unique_ptr<ResultQuery> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
Expand All @@ -1144,16 +1144,16 @@ void ResultQuery::del() {
bool ResultQuery::typeIsCorrect() {
return type == type__;
}
std::auto_ptr<ResultQuery> ResultQuery::upcast() {
return auto_ptr<ResultQuery>(new ResultQuery(*this));
std::unique_ptr<ResultQuery> ResultQuery::upcast() {
return unique_ptr<ResultQuery>(new ResultQuery(*this));
}
std::auto_ptr<ResultQuery> ResultQuery::upcastCopy() {
std::unique_ptr<ResultQuery> ResultQuery::upcastCopy() {
ResultQuery* np = new ResultQuery(*this);
np->id = id;
np->type = type;
np->query = query;
np->inDatabase = inDatabase;
return auto_ptr<ResultQuery>(np);
return unique_ptr<ResultQuery>(np);
}
std::ostream & operator<<(std::ostream& os, ResultQuery o) {
os << "-------------------------------------" << std::endl;
Expand Down Expand Up @@ -1284,7 +1284,7 @@ void RequestedResult::update() {
}
void RequestedResult::del() {
if (typeIsCorrect() == false) {
std::auto_ptr<RequestedResult> p(upcastCopy());
std::unique_ptr<RequestedResult> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
Expand All @@ -1297,16 +1297,16 @@ void RequestedResult::del() {
bool RequestedResult::typeIsCorrect() {
return type == type__;
}
std::auto_ptr<RequestedResult> RequestedResult::upcast() {
return auto_ptr<RequestedResult>(new RequestedResult(*this));
std::unique_ptr<RequestedResult> RequestedResult::upcast() {
return unique_ptr<RequestedResult>(new RequestedResult(*this));
}
std::auto_ptr<RequestedResult> RequestedResult::upcastCopy() {
std::unique_ptr<RequestedResult> RequestedResult::upcastCopy() {
RequestedResult* np = new RequestedResult(*this);
np->id = id;
np->type = type;
np->result = result;
np->inDatabase = inDatabase;
return auto_ptr<RequestedResult>(np);
return unique_ptr<RequestedResult>(np);
}
std::ostream & operator<<(std::ostream& os, RequestedResult o) {
os << "-------------------------------------" << std::endl;
Expand Down
24 changes: 12 additions & 12 deletions openstudiocore/src/model_editor/projectmodeldatabase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ class Project : public litesql::Persistent {
virtual void update();
virtual void del();
virtual bool typeIsCorrect();
std::auto_ptr<Project> upcast();
std::auto_ptr<Project> upcastCopy();
std::unique_ptr<Project> upcast();
std::unique_ptr<Project> upcastCopy();
};
std::ostream & operator<<(std::ostream& os, Project o);
class Analysis : public litesql::Persistent {
Expand Down Expand Up @@ -234,8 +234,8 @@ class Analysis : public litesql::Persistent {
virtual void update();
virtual void del();
virtual bool typeIsCorrect();
std::auto_ptr<Analysis> upcast();
std::auto_ptr<Analysis> upcastCopy();
std::unique_ptr<Analysis> upcast();
std::unique_ptr<Analysis> upcastCopy();
};
std::ostream & operator<<(std::ostream& os, Analysis o);
class Model : public litesql::Persistent {
Expand Down Expand Up @@ -298,8 +298,8 @@ class Model : public litesql::Persistent {
virtual void update();
virtual void del();
virtual bool typeIsCorrect();
std::auto_ptr<Model> upcast();
std::auto_ptr<Model> upcastCopy();
std::unique_ptr<Model> upcast();
std::unique_ptr<Model> upcastCopy();
};
std::ostream & operator<<(std::ostream& os, Model o);
class Result : public litesql::Persistent {
Expand Down Expand Up @@ -358,8 +358,8 @@ class Result : public litesql::Persistent {
virtual void update();
virtual void del();
virtual bool typeIsCorrect();
std::auto_ptr<Result> upcast();
std::auto_ptr<Result> upcastCopy();
std::unique_ptr<Result> upcast();
std::unique_ptr<Result> upcastCopy();
};
std::ostream & operator<<(std::ostream& os, Result o);
class ResultQuery : public litesql::Persistent {
Expand Down Expand Up @@ -418,8 +418,8 @@ class ResultQuery : public litesql::Persistent {
virtual void update();
virtual void del();
virtual bool typeIsCorrect();
std::auto_ptr<ResultQuery> upcast();
std::auto_ptr<ResultQuery> upcastCopy();
std::unique_ptr<ResultQuery> upcast();
std::unique_ptr<ResultQuery> upcastCopy();
};
std::ostream & operator<<(std::ostream& os, ResultQuery o);
class RequestedResult : public litesql::Persistent {
Expand Down Expand Up @@ -468,8 +468,8 @@ class RequestedResult : public litesql::Persistent {
virtual void update();
virtual void del();
virtual bool typeIsCorrect();
std::auto_ptr<RequestedResult> upcast();
std::auto_ptr<RequestedResult> upcastCopy();
std::unique_ptr<RequestedResult> upcast();
std::unique_ptr<RequestedResult> upcastCopy();
};
std::ostream & operator<<(std::ostream& os, RequestedResult o);
class ProjectModelDatabase : public litesql::Database {
Expand Down

3 comments on commit 4b995c9

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (axelstudios) - x86_64-MacOS-10.9-clang: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iteration (axelstudios) - x86_64-Linux-Ubuntu-14.04-clang-3.5: OK (2124 of 2200 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iteration (axelstudios) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

Please sign in to comment.