From 8f75bfbed5bcdbed2dbd9c171c3e6ab639609dc3 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 2 May 2017 00:51:04 +0200 Subject: [PATCH] ENH: add HashTable::writeKeys and HashSet::writeList - can use the hash-set writeList in combination with FlatOutput: Eg, flatOutput(myHashSet); --- applications/test/HashSet/Test-hashSet.C | 11 ++-- .../containers/HashTables/HashSet/HashSet.C | 9 ++++ .../containers/HashTables/HashSet/HashSet.H | 10 ++++ .../HashTables/HashTable/HashTable.H | 12 +++-- .../HashTables/HashTable/HashTableIO.C | 50 ++++++++++++++++++- 5 files changed, 83 insertions(+), 9 deletions(-) diff --git a/applications/test/HashSet/Test-hashSet.C b/applications/test/HashSet/Test-hashSet.C index 087041db78..1534065a46 100644 --- a/applications/test/HashSet/Test-hashSet.C +++ b/applications/test/HashSet/Test-hashSet.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,7 @@ Description #include "HashSet.H" #include "Map.H" #include "labelPairHashes.H" +#include "FlatOutput.H" using namespace Foam; @@ -66,6 +67,8 @@ int main(int argc, char *argv[]) tableB.insert("value5", nil()); tableB.insert("value6", nil()); + Info<< "tableA keys: "; tableA.writeKeys(Info) << endl; + Map