Go to the documentation of this file.
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>
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>());
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
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)....
HashPtrTable()=default
Default construct with default table capacity.
void write(Ostream &os) const
Invoke write() on each non-null entry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
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,...