STYLE: add data/cdata to VectorSpace for consistency with FixedList etc

This commit is contained in:
Mark Olesen
2019-08-06 12:00:56 +02:00
committed by Andrew Heather
parent c28d785a73
commit 0cfd019b92
3 changed files with 41 additions and 1 deletions

View File

@ -178,6 +178,12 @@ public:
inline void component(Cmpt&, const direction) const;
inline void replace(const direction, const Cmpt&);
//- Return const pointer to the first data element
inline const Cmpt* cdata() const noexcept;
//- Return pointer to the first data element
inline Cmpt* data() noexcept;
//- Return a VectorSpace with all elements = s
inline static Form uniform(const Cmpt& s);
@ -213,7 +219,7 @@ public:
//- Return an iterator to begin of VectorSpace
inline iterator begin();
//- Return an iterator to end of UListVectorSpace
//- Return an iterator to end of VectorSpace
inline iterator end();

View File

@ -193,6 +193,20 @@ Foam::VectorSpace<Form, Cmpt, Ncmpts>::block() const
// * * * * * * * * * * * * * * * * Iterator * * * * * * * * * * * * * * * * //
template<class Form, class Cmpt, Foam::direction Ncmpts>
inline Cmpt* Foam::VectorSpace<Form, Cmpt, Ncmpts>::data() noexcept
{
return v_;
}
template<class Form, class Cmpt, Foam::direction Ncmpts>
inline const Cmpt* Foam::VectorSpace<Form, Cmpt, Ncmpts>::cdata() const noexcept
{
return v_;
}
template<class Form, class Cmpt, Foam::direction Ncmpts>
inline Cmpt* Foam::VectorSpace<Form, Cmpt, Ncmpts>::begin()
{