#include <string>
#include <iostream>
#include <iomanip>
#include "JTools/JHashSet.hh"
#include "JLang/JObjectID.hh"
#include "JIO/JFileStreamIO.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
 
Go to the source code of this file.
 | 
| int  | main (int argc, char **argv) | 
|   | 
Example program to test JTOOLS::JHashSet class. 
- Author
 - mdejong 
 
Definition in file JHashSet.cc.
 
◆ main()
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char **  | 
          argv  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 48 of file JHashSet.cc.
   58     JParser<> zap(
"Example program to test hash set.");
 
   66   catch(
const exception &error) {
 
   67     FATAL(error.what() << endl);
 
   77   if (inputFile != 
"") {
 
   79     DEBUG(
"Reading " << inputFile << 
"... " << flush);
 
   91     for (
int i = 1<<10; i != 0; i >>= 1) {
 
   92       buffer.insert(__A__(i));
 
   95     buffer.erase(buffer.find(1<<2), buffer.find(1<<4));
 
   97     if (!buffer.erase(1<<4)) {
 
   98       FATAL(
"Erasing value failed." << endl);
 
  102   for (hash_set::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
 
  104     cout << setw(4) << *i;
 
  107     hash_set::const_iterator p = buffer.find(*i);
 
  109     if (p != buffer.end())
 
  110       cout << setw(4) << *p << endl;
 
  112       FATAL(
"Inconsistent has set at " << *i << endl);