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 this->
reserve(this->size() + len);
66 if (delimiter == token::BEGIN_LIST)
68 for (label i=0; i<len; ++i)
72 this->
set(
key, inew(
key, is).ptr());
76 "HashPtrTable::readIstream : " 84 <<
"incorrect first token, '(', found " 91 is.readEndList(
"HashPtrTable");
93 else if (tok.isPunctuation(token::BEGIN_LIST))
97 while (!tok.isPunctuation(token::END_LIST))
102 this->
set(
key, inew(
key, is).ptr());
106 "HashPtrTable::readIstream : " 116 <<
"incorrect first token, expected <int> or '(', found " 125 template<
class T,
class Key,
class Hash>
129 const dictionary&
dict,
134 for (
const entry&
e :
dict)
136 this->
set(
e.keyword(), inew(
e.dict()).ptr());
141 template<
class T,
class Key,
class Hash>
144 for (const_iterator iter = this->
cbegin(); iter != this->
cend(); ++iter)
146 const T* ptr = iter.val();
157 template<
class T,
class Key,
class Hash>
161 this->readIstream(is, inew);
165 template<
class T,
class Key,
class Hash>
168 this->readIstream(is,
INew<T>());
172 template<
class T,
class Key,
class Hash>
181 template<
class T,
class Key,
class Hash>
185 tbl.readIstream(is, INew<T>());
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
triangles reserve(surf.size())
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...