coordinateSystem: Added copy constructor and assignment operator
Resolves bug-report https://bugs.openfoam.org/view.php?id=3727
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -89,6 +89,14 @@ Foam::coordinateSystem::coordinateSystem
|
||||
{}
|
||||
|
||||
|
||||
Foam::coordinateSystem::coordinateSystem(const coordinateSystem& cs)
|
||||
:
|
||||
name_(cs.name_),
|
||||
origin_(cs.origin_),
|
||||
R_(cs.R_, false)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::coordinateSystem::~coordinateSystem()
|
||||
@ -193,6 +201,16 @@ void Foam::coordinateSystem::writeDict(Ostream& os, bool subDict) const
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::coordinateSystem::operator=(const coordinateSystem& cs)
|
||||
{
|
||||
name_ = cs.name_;
|
||||
origin_ = cs.origin_;
|
||||
R_ = cs.R_->clone();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const coordinateSystem& cs)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -160,6 +160,9 @@ public:
|
||||
//- Construct from dictionary with a given name
|
||||
coordinateSystem(const word& name, const dictionary&);
|
||||
|
||||
//- Copy constructor
|
||||
coordinateSystem(const coordinateSystem& cs);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<coordinateSystem> clone() const
|
||||
{
|
||||
@ -306,6 +309,12 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Assignment operator
|
||||
void operator=(const coordinateSystem&);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Ostream& operator<<(Ostream&, const coordinateSystem&);
|
||||
|
||||
Reference in New Issue
Block a user