Commit Graph

24 Commits

Author SHA1 Message Date
6933bc3021 ENH: HashPtrTable remove/erase now include safeguard against end-iterator
- This makes the following safe:

      auto iter = ptrTable.find(unknownKey);
      ptrTable.erase(iter);

- Unmask HashPtrTable::erase(const Key& key) method
2017-05-15 09:57:25 +02:00
759306a3e2 STYLE: more consistent typedefs in Map, PtrMap, HashPtrTable 2017-05-04 02:47:32 +02:00
c0a50dc621 ENH: improve overall consistency of the HashTable and its iterators
- previously had a mismash of const/non-const attributes on iterators
  that were confused with the attributes of the object being accessed.

- use the iterator keys() and object() methods consistently for all
  internal access of the HashTable iterators. This makes the intention
  clearer, the code easier to maintain, and protects against any
  possible changes in the definition of the operators.

- 'operator*': The standard form expected by STL libraries.
  However, for the std::map, this dereferences to a <key,value> pair,
  whereas OpenFOAM dereferences simply to <value>.

- 'operator()': OpenFOAM treats this like the 'operator*'

- adjusted the values of end() and cend() to reinterpret from nullObject
  instead of returning a static iteratorEnd() object.
  This means that C++ templates can now correctly deduce and match
  the return types from begin() and end() consistently.
  So that range-based now works.

  Eg,
      HashTable<label> table1 = ...;
      for (auto i : table1)
      {
          Info<< i << endl;
      }

  Since the 'operator*' returns hash table values, this prints all the
  values in the table.
2017-05-02 00:15:12 +02:00
31da01d1ea STYLE: cleanup doxygen for HashTable/HashSet
- remove stray canonicalSize declaration
2017-04-11 09:32:53 +02:00
2b9b2dd865 BUG: HashPtrTable has problems with null pointers (issue #395)
- print and copy operations should not be allowed to dereference a
  nullptr.
2017-01-26 18:00:33 +01:00
0db8ff34fd src/OpenFOAM/containers: Updated formatting and comments 2016-02-28 18:21:58 +00:00
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
9224daad7b COMP: add 'this->' qualifier to find methods in base case 2010-12-17 15:39:50 +01:00
a8a7b0a5b4 ENH: Added write(Ostream&) function to HashPtrTable 2010-10-13 17:55:14 +01:00
9de20a6654 ENH: Added HashPtrTable construct INew from dictionary 2010-10-11 17:28:56 +01:00
d79237597e STYLE: Fixing code style requirements for all src. 2010-07-28 13:31:46 +01:00
b6f3bd4c23 STYLE: follow coding guide recommendation for '//- Destructor' 2010-04-12 11:55:52 +02:00
c508b2fe17 STYLE: consistent capitalization of Private/Protected Member Functions in comments 2010-03-30 11:33:42 +02:00
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
3345fd8378 Removed support for cint. 2009-06-22 21:03:57 +01:00
2aeee852e8 PackedList bugfix, HashTable tweak
- it was possible to create a PackedList::iterator from a
  PackedList::const_iterator and violate const-ness

- added HashTable::printInfo for emitting some information

- changed default table sizes from 100 -> 128 in preparation for future
  2^n table sizes
2009-02-26 15:32:47 +01:00
a2b24d07a8 draft for having a resizing granularity in DynamicList
- nice idea, but need to convince compiler that division by zero doesn't occur
2009-01-15 10:03:23 +01:00
c2ac216eaf HashTable::erase from list of keys or the keys from another HashTable
- the parameter HashTable can hold arbitrary data .. just the type of keys
  needs to match
2009-01-11 20:01:53 +01:00
28b200bcd9 update copyrights for 2009 2008-12-31 19:01:56 +01:00
02cabc3cf2 updated Copyright (C) \d+-2008 OpenCFD Ltd. 2008-06-25 15:01:46 +02:00
3170c7c0c9 Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00