CosmoToolbox samples
This commit is contained in:
parent
1b46dfa245
commit
1d9ce1c264
4 changed files with 225 additions and 0 deletions
33
sample/testBQueue.cpp
Normal file
33
sample/testBQueue.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <iostream>
|
||||
#include "bqueue.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CosmoTool::BoundedQueue<int,int,100000> bq(4);
|
||||
|
||||
for (int i = 10; i >= 0; i--)
|
||||
{
|
||||
bq.push(i, i);
|
||||
|
||||
int *prio = bq.getPriorities();
|
||||
for (int j = 0; j < 4; j++)
|
||||
cout << prio[j] << " ";
|
||||
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
for (int i = 1; i >= -2; i--)
|
||||
{
|
||||
bq.push(i, i);
|
||||
|
||||
int *prio = bq.getPriorities();
|
||||
for (int j = 0; j < 4; j++)
|
||||
cout << prio[j] << " ";
|
||||
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue