houxiao
2016-12-28 4ef430e946e717d72e923c4708a9120f94d55dbd
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _PL_QUEUE_H_
#define _PL_QUEUE_H_
 
#include "PipeLine.h"
 
struct PL_Queue_Config
{
    size_t maxBlockCount;
    size_t maxBlockSize;
    bool cacheEmptyBlock;//#todo not implement
    
    bool syncQueueFull;
    bool syncQueueEmpty;
    bool queueFullDropBlock;
    bool copyData; //#todo not implement (copy ptr)
    
    PL_Queue_Config() : 
        maxBlockCount(100), maxBlockSize(300000), cacheEmptyBlock(false), 
        syncQueueFull(true), syncQueueEmpty(true), queueFullDropBlock(false), copyData(true)
    {
    }
};
 
class PL_Queue : public PipeLineElem
{
public:
    PL_Queue();
    virtual ~PL_Queue();
 
    virtual bool init(void* args);
    virtual void finit();
 
    virtual bool pay(const PipeMaterial& pm);
    virtual bool gain(PipeMaterial& pm);
    
private:
    static void pm_deleter_qb(PipeMaterial* pm);
 
    void* internal;
};
 
PipeLineElem* create_PL_Queue();
 
#endif