37 template<
class T,
class Key,
class Hash>
51 "HashPtrTable::readIstream : " 57 const label len = tok.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 " 94 is.readEndList(
"HashPtrTable");
96 else if (tok.isPunctuation(token::BEGIN_LIST))
100 while (!tok.isPunctuation(token::END_LIST))
105 this->
set(
key, inew(
key, is).ptr());
109 "HashPtrTable::readIstream : " 119 <<
"incorrect first token, expected <int> or '(', found " 128 template<
class T,
class Key,
class Hash>
132 const dictionary&
dict,
136 for (
const entry&
e :
dict)
138 this->
set(
e.keyword(), inew(
e.dict()).ptr());
143 template<
class T,
class Key,
class Hash>
146 for (const_iterator iter = this->
cbegin(); iter != this->
cend(); ++iter)
148 const T* ptr = iter.val();
159 template<
class T,
class Key,
class Hash>
163 this->readIstream(is, inew);
167 template<
class T,
class Key,
class Hash>
170 this->readIstream(is,
INew<T>());
174 template<
class T,
class Key,
class Hash>
183 template<
class T,
class Key,
class Hash>
187 tbl.readIstream(is, INew<T>());
errorManipArg< error, int > exit(error &err, const int errNo=1)
patchWriters resize(patchIds.size())
A list of keyword definitions, which are a keyword followed by a number of values (eg...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
void write(Ostream &os) const
Invoke write() on each non-null entry.
const dimensionedScalar e
Elementary charge.
Istream & operator>>(Istream &, directionInfo &)
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
HashPtrTable()=default
Default construct with default table capacity.
OBJstream os(runTime.globalPath()/outputName)
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
A helper class when constructing from an Istream or dictionary.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...