Skip to content
Snippets Groups Projects
  1. May 17, 2017
  2. May 15, 2017
  3. May 10, 2017
  4. May 08, 2017
  5. May 07, 2017
  6. May 05, 2017
  7. May 04, 2017
  8. May 02, 2017
  9. May 01, 2017
    • Mark OLESEN's avatar
      ENH: HashSet iterators operator* now return Key. · f8c58bdd
      Mark OLESEN authored
      - much more useful than returning nil. Can now use with a for range:
      
          for (auto i : myLabelHashSet)
          {
              ...
          }
      f8c58bdd
    • Mark OLESEN's avatar
      ENH: add HashTable::writeKeys and HashSet::writeList · 8f75bfbe
      Mark OLESEN authored
      - can use the hash-set writeList in combination with FlatOutput:
      
        Eg, flatOutput(myHashSet);
      8f75bfbe
    • Mark OLESEN's avatar
      ENH: improve overall consistency of the HashTable and its iterators · c0a50dc6
      Mark OLESEN authored
      - 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.
      c0a50dc6
    • Mark OLESEN's avatar
      ENH: ensure nullObject is large enough for reinterpret · 0298c02b
      Mark OLESEN authored
      - previously occupied 1 byte. Now occupies enough to hold a pointer,
        which helps if using reinterpret_cast to something that has some
        member content.
      0298c02b
    • Mark OLESEN's avatar
      BUG: comparison to static end() for hashtable lookup. · 7cceda62
      Mark OLESEN authored
      - just use the iterator method found() as an alternative and
        convenient way to avoid the issue with less typing.
      7cceda62
    • Mark OLESEN's avatar
      BUG: comparison with incorrect construction tables · dc57c016
      Mark OLESEN authored
      - previously hidden when hashtable used a static method and a
        different class for end()
      dc57c016
    • Mark OLESEN's avatar
      ENH: support UList[labelRange] and SubList construction with labelRange · 805b76d4
      Mark OLESEN authored
      This uses a concept similar to what std::valarray and std::slice do.
      A labelRange provides a convenient container for holding start/size
      and lends itself to addressing 'sliced' views of lists.
      For safety, the operations and constructors restricts the given input range
      to a valid addressible region of the underlying list, while the labelRange
      itself precludes negative sizes.
      
      The SubList version is useful for patches or other things that have a
      SubList as its parameter. Otherwise the UList [] operator will be the
      more natural solution. The slices can be done with a labelRange, or
      a {start,size} pair.
      
      Examples,
           labelList list1 = identity(20);
      
           list1[labelRange(18,10)]  = -1;
           list1[{-20,25}] = -2;
           list1[{1000,5}] = -3;
      
           const labelList list2 = identity(20);
           list2[{5,10}] = -3;  // ERROR: cannot assign to const!
      805b76d4
  10. Apr 30, 2017