Quantitative Analysis.
Trading Platform.
Python for Excel.
Author.
I.Installation.
II.OTS Scheduler.
1.Threading primitives.
2.NonBlockingQueue.
A.NonBlockingQueue design.
B.Simplest example with NonBlockingQueue.
C.NonBlockingQueue prototypes.
D.NonBlockingQueue data fields.
E.NonBlockingQueue::push member function.
F.NonBlockingQueue::pop member function.
G.NonBlockingQueue::Element.
H.NonBlockingQueue::Node.
I.Python-based acceptance test of NonBlockingQueue.
3.ThreadPool.
4.ThreadMaster.
5.Scheduler implementation.
III.OTS Python Object Browser.
Bibliography.
Forum Index Contents Downloads

Simplest example with NonBlockingQueue.


he following code is the simplest example of use.

Line 07: Create a queue.

Line 09: Create a piece of data.

Line 10: Push the piece of data into the queue.

Line 11: Pop the piece of data from the queue.

01|#include <NonBlockingQueue.hpp>

02|typedef std::string TestData;

02a|typedef ots::scheduler::NonBlockingQueue<TestData> TestQueue;

02b|typedef TestQueue::Node TestNode;

03|bool simpleTest()

04|{

07|TestQueue queue;

08|const std::string s("Hello!");

09|TestNode node(s);

10|queue.push(node);

11|volatile TestNode& n=queue.pop();

12|return &node==&n;

13|}





Forum Index Contents Download


















Copyright 2009.