完成bitmap
This commit is contained in:
@@ -22,7 +22,6 @@ namespace TinySTL{
|
|||||||
enum EAlign{ ALIGN = 8 };
|
enum EAlign{ ALIGN = 8 };
|
||||||
public:
|
public:
|
||||||
bitmap();
|
bitmap();
|
||||||
explicit bitmap(const std::string& str);//TODO
|
|
||||||
|
|
||||||
//Returns the number of bits in the bitset that are set (i.e., that have a value of one)
|
//Returns the number of bits in the bitset that are set (i.e., that have a value of one)
|
||||||
size_t count() const;
|
size_t count() const;
|
||||||
|
|||||||
@@ -1,29 +1,30 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <mutex>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
#include <thread>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <boost\circular_buffer.hpp>
|
#include <boost\circular_buffer.hpp>
|
||||||
|
|
||||||
#include "CircularBuffer.h"
|
#include "Bitmap.h"
|
||||||
#include "Profiler\Profiler.h"
|
#include "Profiler\Profiler.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace TinySTL::Profiler;
|
using namespace TinySTL::Profiler;
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
TinySTL::circular_buffer<int, 10000> cb(10000, 0);
|
std::string str("abcdefghijklmnpqrstuvwxyz");
|
||||||
//boost::circular_buffer<int> cb(10000, 0);
|
TinySTL::bitmap<26> bm;
|
||||||
ProfilerInstance::start();
|
for (auto it = str.cbegin(); it != str.cend(); ++it){
|
||||||
for (int i = 0; i != 100; ++i){
|
bm.set(*it - 'a');
|
||||||
cb.push_back(i);
|
|
||||||
}
|
}
|
||||||
ProfilerInstance::finish();
|
cout << bm << endl;
|
||||||
ProfilerInstance::dumpDuringTime();
|
cout << bm.size() << endl;
|
||||||
system("pause");
|
system("pause");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user