Menu

[r218]: / cache / trunk / cache-test.cpp  Maximize  Restore  History

Download this file

28 lines (24 with data), 501 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "cache.h"
#include <iostream>
using namespace cache;
using namespace std;
int main()
{
thread_cache c(5);
c.insert("1","odd","one",10);
c.insert("2","even","two",10);
c.insert("3","odd","three",10);
c.insert("4","even","four",10);
c.insert("5","odd","five",10);
c.insert("6","even","six",10);
int i,k;
for(k=0;k<2;k++){
for(i='1';i<='6';i++) {
char buf[2]={i,0};
string out;
cout<<c.fetch_string(buf,out)<<":"<<out<<endl;
}
c.drop_secondary("odd");
}
return 0;
}
MongoDB Logo MongoDB