Go to the documentation of this file.
37 template<
class T,
class Key,
class Hash>
51 "HashPtrTable::readIstream : "
55 if (firstToken.isLabel())
57 const label len = firstToken.labelToken();
60 const char delimiter = is.readBeginList(
"HashPtrTable");
64 if (2*len > this->capacity())
69 if (delimiter == token::BEGIN_LIST)
71 for (label i=0; i<len; ++i)
75 this->
set(key, inew(key, is).ptr());
79 "HashPtrTable::readIstream : "
87 <<
"incorrect first token, '(', found " << firstToken.info()
93 is.readEndList(
"HashPtrTable");
95 else if (firstToken.isPunctuation())
97 if (firstToken.pToken() != token::BEGIN_LIST)
100 <<
"incorrect first token, '(', found " << firstToken.info()
108 lastToken.isPunctuation()
109 && lastToken.pToken() == token::END_LIST
113 is.putBack(lastToken);
116 this->
set(key, inew(key, is).ptr());
120 "HashPtrTable::readIstream : "
130 <<
"incorrect first token, expected <int> or '(', found "
139 template<
class T,
class Key,
class Hash>
143 const dictionary&
dict,
147 for (
const entry&
e :
dict)
149 this->
set(
e.keyword(), inew(
e.dict()).ptr());
154 template<
class T,
class Key,
class Hash>
159 const T* ptr = iter.val();
170 template<
class T,
class Key,
class Hash>
174 this->readIstream(is, inew);
178 template<
class T,
class Key,
class Hash>
181 this->readIstream(is,
INew<T>());
185 template<
class T,
class Key,
class Hash>
194 template<
class T,
class Key,
class Hash>
198 tbl.readIstream(is,
INew<T>());
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Istream & operator>>(Istream &, directionInfo &)
A helper class when constructing from an Istream or dictionary.
void clear()
Clear all entries from table and delete any allocated pointers.
patchWriters resize(patchIds.size())
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void write(Ostream &os) const
Write.
HashPtrTable()
Default construct with default table capacity.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
errorManipArg< error, int > exit(error &err, const int errNo=1)
typename parent_type::const_iterator const_iterator
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
const dimensionedScalar e
Elementary charge.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...