34 template<
class T,
class Key,
class Hash>
38 is.fatalCheck(
"HashPtrTable<T, Key, Hash>::read(Istream&, const INew&)");
44 "HashPtrTable<T, Key, Hash>::read(Istream&, const INew&) : "
48 if (firstToken.isLabel())
50 label s = firstToken.labelToken();
53 char delimiter = is.readBeginList(
"HashPtrTable<T, Key, Hash>");
57 if (2*
s > this->tableSize_)
62 if (delimiter == token::BEGIN_LIST)
68 this->
insert(key, inewt(key, is).ptr());
72 "HashPtrTable<T, Key, Hash>::"
73 "read(Istream&, const INew&) : reading entry"
82 ) <<
"incorrect first token, '(', found " << firstToken.info()
88 is.readEndList(
"HashPtrTable");
90 else if (firstToken.isPunctuation())
92 if (firstToken.pToken() != token::BEGIN_LIST)
97 ) <<
"incorrect first token, '(', found " << firstToken.info()
105 lastToken.isPunctuation()
106 && lastToken.pToken() == token::END_LIST
110 is.putBack(lastToken);
113 this->
insert(key, inewt(key, is).ptr());
117 "HashPtrTable<T, Key, Hash>::read(Istream&, const INew&) : "
129 ) <<
"incorrect first token, expected <int> or '(', found "
134 is.fatalCheck(
"HashPtrTable<T, Key, Hash>::read(Istream&, const INew&)");
138 template<
class T,
class Key,
class Hash>
142 const dictionary&
dict,
151 inewt(
dict.subDict(iter().keyword())).ptr()
157 template<
class T,
class Key,
class Hash>
164 iter = this->begin();
169 const T* ptr = iter();
177 template<
class T,
class Key,
class Hash>
181 this->
read(is, inewt);
185 template<
class T,
class Key,
class Hash>
192 template<
class T,
class Key,
class Hash>
201 template<
class T,
class Key,
class Hash>
211 template<
class T,
class Key,
class Hash>
215 const HashPtrTable<T, Key, Hash>& L
219 os <<
nl << L.
size() <<
nl << token::BEGIN_LIST <<
nl;
224 typename HashPtrTable<T, Key, Hash>::const_iterator iter = L.
begin();
229 os << iter.key() << token::SPACE << *iter() <<
nl;
233 os << token::END_LIST;
236 os.check(
"Ostream& operator<<(Ostream&, const HashPtrTable&)");
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A HashTable specialisation for hashing pointers.
void write(Ostream &os) const
Write.
void clear()
Clear all entries from table.
An STL-conforming const_iterator.
iterator begin()
Iterator set to the beginning of the HashTable.
label size() const
Return number of elements in table.
friend class HashPtrTable
Declare friendship with the HashPtrTable class.
A helper class when constructing from an Istream or dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
A token holds items read from Istream.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Istream & operator>>(Istream &, pistonPointEdgeData &)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
triSurfaceToAgglom resize(surfacesMesh.size())
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable