Modernize code:

* Clean STBase-derived class creation interfaces
* Annotate overriden STBase virtual functions
* Optimize path deserialization
* Prefer range-based for
* Prefer std::unique_ptr
* Remove BOOST_FOREACH
This commit is contained in:
Nik Bougalis
2014-12-31 22:02:14 -08:00
parent e742da73bd
commit 47593730d6
43 changed files with 638 additions and 547 deletions

View File

@@ -42,40 +42,45 @@ public:
typedef vector::size_type size_type;
public:
STArray ()
{
;
}
explicit STArray (int n)
STArray () = default;
explicit
STArray (int n)
{
value.reserve (n);
}
explicit STArray (SField::ref f) : STBase (f)
{
;
}
STArray (SField::ref f, int n) : STBase (f)
explicit
STArray (SField::ref f)
: STBase (f)
{ }
STArray (SField::ref f, int n)
: STBase (f)
{
value.reserve (n);
}
STArray (SField::ref f, const vector & v) : STBase (f), value (v)
{
;
}
explicit STArray (vector & v) : value (v)
{
;
}
virtual ~STArray () { }
STArray (SField::ref f, const vector& v)
: STBase (f), value (v)
{ }
static std::unique_ptr<STBase>
explicit
STArray (vector & v)
: value (v)
{ }
virtual ~STArray () = default;
static
std::unique_ptr<STBase>
deserialize (SerializerIterator & sit, SField::ref name);
const vector& getValue () const
{
return value;
}
vector& getValue ()
{
return value;
@@ -197,10 +202,10 @@ public:
return value.empty ();
}
private:
virtual STArray* duplicate () const override
std::unique_ptr<STBase>
duplicate () const override
{
return new STArray (*this);
return std::make_unique<STArray>(*this);
}
private: