Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "WriteOutFile.h"
- extern concurrent_hash_map<unsigned char, unsigned int> couterValues;
- RetVal WriteOutFile(string fileName)
- {
- ofstream outputFile(fileName.c_str());
- if (outputFile.is_open() == false)
- {
- cout << "WriteOutFile: Output file " << fileName << " could not be opened." << endl;
- return RET_ERROR;
- }
- for(int i=0; i<256; i++)
- {
- concurrent_hash_map<unsigned char, unsigned int>::accessor a;
- if(couterValues.find(a, i))
- {
- outputFile << i << ":\t" << a->second << endl;
- }
- }
- outputFile.close();
- return RET_OK;
- }
- -----------------------------------------
- #ifndef _WRITE_OUT_FILE_H_
- #define _WRITE_OUT_FILE_H_
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <queue>
- #include <tbb/concurrent_hash_map.h>
- #include "defines.h"
- using namespace std;
- using namespace tbb;
- RetVal WriteOutFile(string fileName);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement