1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 \*---------------------------------------------------------------------------*/
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 int main(int argc, char *argv[])
39 HashTable<label, word> tableA;
41 HashTable<nil> tableB;
47 tableA.insert("value1", 1);
48 tableA.insert("value2", 2);
49 tableA.insert("value3", 3);
51 tableB.insert("value4", nil());
52 tableB.insert("value5", nil());
53 tableB.insert("value6", nil());
61 Info<< tableA << endl;
64 Info<< "create from HashSet: ";
65 Info<< wordHashSet(setA) << endl;
66 Info<< "create from HashTable<T>: ";
67 Info<< wordHashSet(tableA) << endl;
68 Info<< "create from HashTable<nil>: ";
69 Info<< wordHashSet(tableB) << endl;
71 Info<< "create from Map<label>: ";
72 Info<< labelHashSet(mapA) << endl;
74 Info<<"combined toc: "
75 << (wordHashSet(setA) | wordHashSet(tableA) | wordHashSet(tableB))
83 Info<< "setB : " << setB << endl;
89 Info<< "setC : " << setC << endl;
96 Info<< "setD : " << setD << endl;
98 Info<< "setB == setC: " << (setB == setC) << endl;
99 Info<< "setC != setD: " << (setC != setD) << endl;
103 Info<< "setB += setC : " << setB << endl;
106 Info<< "setB &= setD : " << setB << endl;
108 Info<< "setB : " << setB << endl;
109 Info<< "setC : " << setC << endl;
110 Info<< "setD : " << setD << endl;
111 Info<< "setB ^ setC ^ setD : " << (setB ^ setC ^ setD) << endl;
115 Info<< "setD : " << setD << endl;
118 Info<< "setD has 0" << endl;
122 Info<< "setD has no 0" << endl;
128 Info<< "setD has 11" << endl;
132 Info<< "setD has no 0" << endl;
135 Info<< "setD : " << setD << endl;
137 // this doesn't work (yet?)
144 // ************************************************************************* //