Boring changes - core.

This and several following commits contain the "boring" changes required
to support the new Ptr. These are changes like:

* new T -> makePtr<T> or .reset(new T) or Ptr<T>(new T)
  (depending on the situation)
* p.empty() -> !p
* delete_obj -> DefaultDeleter::operator()

and similar changes that are numerous, but primitive.
This commit is contained in:
Roman Donchenko
2013-08-13 16:22:07 +04:00
parent 461c98fa86
commit 8200a95ced
14 changed files with 58 additions and 87 deletions

View File

@@ -163,7 +163,7 @@ Ptr<Algorithm> Algorithm::_create(const String& name)
Algorithm::Constructor c = 0;
if( !alglist().find(name, c) )
return Ptr<Algorithm>();
return c();
return Ptr<Algorithm>(c());
}
Algorithm::Algorithm()
@@ -490,7 +490,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
else if( p.type == Param::ALGORITHM )
{
Ptr<Algorithm> nestedAlgo = Algorithm::_create((String)n["name"]);
CV_Assert( !nestedAlgo.empty() );
CV_Assert( nestedAlgo );
nestedAlgo->read(n);
info->set(algo, pname.c_str(), p.type, &nestedAlgo, true);
}