ENH: Added write(Ostream&) function to HashPtrTable

This commit is contained in:
andy
2010-10-13 17:55:14 +01:00
parent fc38a586a4
commit a8a7b0a5b4
2 changed files with 21 additions and 0 deletions

View File

@ -121,6 +121,9 @@ public:
//- Clear all entries from table
void clear();
//- Write
void write(Ostream& os) const;
// Member Operators

View File

@ -153,6 +153,24 @@ void Foam::HashPtrTable<T, Key, Hash>::read
}
template<class T, class Key, class Hash>
void Foam::HashPtrTable<T, Key, Hash>::write(Ostream& os) const
{
for
(
typename HashPtrTable<T, Key, Hash>::const_iterator
iter = this->begin();
iter != this->end();
++iter
)
{
const T* ptr = iter();
ptr->write(os);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class T, class Key, class Hash>