MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / main

Function main

applications/test/HashSet/Test-hashSet.C:36–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34// Main program:
35
36int main(int argc, char *argv[])
37{
38 wordHashSet setA(0);
39 HashTable<label, word> tableA;
40
41 HashTable<nil> tableB;
42 Map<label> mapA;
43
44 setA.insert("kjhk");
45 setA.insert("kjhk2");
46
47 tableA.insert("value1", 1);
48 tableA.insert("value2", 2);
49 tableA.insert("value3", 3);
50
51 tableB.insert("value4", nil());
52 tableB.insert("value5", nil());
53 tableB.insert("value6", nil());
54
55 mapA.set(1, 1);
56 mapA.set(2, 2);
57 mapA.set(3, 3);
58 mapA.set(4, 4);
59
60 Info<< setA << endl;
61 Info<< tableA << endl;
62 Info<< mapA << endl;
63
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;
70
71 Info<< "create from Map<label>: ";
72 Info<< labelHashSet(mapA) << endl;
73
74 Info<<"combined toc: "
75 << (wordHashSet(setA) | wordHashSet(tableA) | wordHashSet(tableB))
76 << nl;
77
78
79 labelHashSet setB(1);
80 setB.insert(11);
81 setB.insert(42);
82
83 Info<< "setB : " << setB << endl;
84
85 labelHashSet setC(1);
86 setC.insert(2008);
87 setC.insert(1984);
88
89 Info<< "setC : " << setC << endl;
90
91 labelHashSet setD(1);
92 setD.insert(11);
93 setD.insert(100);

Callers

nothing calls this directly

Calls 5

nilClass · 0.85
forAllFunction · 0.50
insertMethod · 0.45
setMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected