- string doesn't use any debug info, remove it
- restructured the macros to add in NoDebug macro versions to className,
typeInfo. Might be helpful with tackling the globals bootstrapping issue.
- HashTableName + StaticHashTableName - avoid lookup of debug switch when
FULLDEBUG is not defined
- Problem: changing between OpenFOAM versions with different
WM_PROJECT_INST_DIR paths would leave the old paths in the env vars.
- TODO: etc/cshrc is rougned out, but needs work on the corresponding
if-statement
- motivation: we could probably reuse the Switch::asBool() within boolIO.C
... and possibly make Switch is-a bool and has-a word (or has-a enum for
the word) for reuse with nicer output values for bool
regExp:
- added optional ignoreCase for constructor.
- the compile() methods is now exposed as set(...) method with an optional
ignoreCase argument. Not currently much use for the other regex compile
flags though. The set() method can be used directly instead of the
operator=() assignment.
keyType + wordRe:
- it's not clear that any particular characters are valid/invalid (compared
to string or word), so just drop the valid(char) method for now
wordRe:
- a bool doesn't suffice, added enum compOption (compile-option)
- most constructors now have a compOption. In *all* cases it defaults to
LITERAL - ie, the same behaviour for std::string and Foam::string
- added set(...) methods that do much the same as operator=(...), but the
compOption can be specified. In all cases, it defaults to DETECT.
In Summary
By default the constructors will generally preserve the argument as
string literal and the assignment operators will use the wordRe::DETECT
compOption to scan the string for regular expression meta characters
and/or invalid word characters and react accordingly.
The exceptions are when constructing/assigning from another
Foam::wordRe (preserve the same type) or from a Foam::word (always
literal).
- The capitalization is consistent with most other template classes, but
more importantly frees up xfer() for use as method name without needing
special treatment to avoid ambiguities.
It seems reasonable to have different names for transfer(...) and xfer()
methods, since the transfer is occuring in different directions.
The xfer() method can thus replace the recently introduced zero-parameter
transfer() methods.
Other name candidates (eg, yield, release, etc.) were deemed too abstract.
- a possible future replacement for keyType, but the immediate use is the
wordReList for grepping through other lists.
- note that the argList treatment of '(' ... ')' yields quoted strings,
which we can use for building a wordReList
minor cleanup of regExp class
- constructor from std::string, match std::string and
operator=(std::string&)
rely on automatic conversion to Foam::string
- ditch partialMatch with sub-groups, it doesn't make much sense
- Istream and Ostream now retain backslashes when reading/writing strings.
The previous implementation simply discarded them, except when used to
escape a double-quote or a newline. It is now vitally important to retain
them, eg for quoting regular expression meta-characters.
The backslash continues to be used as an escape character for double-quote
and newline, but otherwise get passed through "as-is" without any other
special meaning (ie, they are *NOT* C-style strings). This helps avoid
'backslash hell'!
For example,
string: "match real dots \.+, question mark \? or any char .*"
C-style: "match real dots \\.+, question mark \\? or any char .*"
- combined subfiles in db/IOstreams, some had more copyright info than code
- OPstreamI.H contained only private methods, moved into OPstream.C
Are these really correct?
IOstreams/Istream.H:# include "HashTable.C"
token/token.H:#define NoHashTableC
- this should provide a slightly more naturally means to using transfer
constructors, for example
labelList list2(list1.transfer());
vs. labelList list2(xferMove(list1));
- returns a plain list where appropriate (eg, DynamicList, SortableList)
for example
labelList list2(dynList1.transfer());
vs. labelList list2(xferMoveTo<labelList>(dynList1));
StaticHashTable:
- erase(iterator&) now actually alters the iterator and iterator++() handles
it properly
- clear() also sets count to zero
- operator=(const StaticHashTable&) doesn't crash after a previous transfer
- operator(), operator==() and operator!=() added
HashTable:
- operator=(const HashTable&) gets tableSize if required, eg, after a
previous transfer)
HashSet / Map
- add xfer<...> constructor for underlying HashTable
- added boundBox(const tmp<pointField>&) constructor for use with
coordinate systems
- moved some methods from treeBoundBox to boundBox and use VectorSpace ops
//- Does the surface need an update?
virtual bool needsUpdate() const = 0;
//- Mark the surface as needing an update.
// May also free up unneeded data.
// Return false if surface was already marked as expired.
virtual bool expire() = 0;
//- Update the surface as required.
// Do nothing (and return false) if no update was required
virtual bool update() = 0;
The constructors for the derived classes should generally start in a
'expired' condition (ie, needsUpdate() == true) and rely on a subsequent
call to the update() method to complete the initialization. Delaying the
final construction as late as possible allows the construction of
surfaces that may depend on intermediate calculation results (eg,
iso-surfaces) and also avoids the unnecessary reconstruction of surfaces
between sampling intervals.
It is the responsibility of the caller to ensure that the surface
update() is called before the surface is used. The update() method
implementation should do nothing when the surface is already up-to-date.