ENH: dimensionSet - added copy/clone functionality

This commit is contained in:
andy
2014-01-09 12:57:40 +00:00
parent a1e9e51870
commit f8991db92d
2 changed files with 19 additions and 3 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,6 +78,12 @@ Foam::dimensionSet::dimensionSet
}
Foam::dimensionSet::dimensionSet(const dimensionSet& ds)
{
reset(ds);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::dimensionSet::dimensionless() const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -158,6 +158,7 @@ private:
label size_;
// Private Member Functions
void push(const token&);
@ -172,6 +173,7 @@ private:
tokeniser(Istream&);
// Member Functions
Istream& stream()
@ -190,7 +192,6 @@ private:
static bool valid(char c);
static label priority(const token& t);
};
@ -244,6 +245,15 @@ public:
const scalar moles
);
//- Copy constructor
dimensionSet(const dimensionSet& ds);
//- Construct and return a clone
autoPtr<dimensionSet> clone() const
{
return autoPtr<dimensionSet>(new dimensionSet(*this));
}
//- Construct from Istream
dimensionSet(Istream&);