派生自 development/c++

pansen
2019-03-07 d3b7bbe7102cd089680a828f5d8f6402c8cf6342
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
45
46
47
48
49
50
#ifndef STRUCTUREAPPI_H
#define STRUCTUREAPPI_H
#include "AppPipeController.h"
#include <atomic>
#include <Ice/Ice.h>
#include "rpc/StructureApp.h"
 
class StructureAppI : public Structure::StructureApp{
 
public:
 
    StructureAppI(int maxCount):currentCount(0),maxCount(maxCount)
    {}
    ~StructureAppI(){
        for(auto controller: controllers){
            delete controller.second;
        }
        controllers.clear();
    }
    // StructureApp interface
public:
    virtual Ice::Int addCamera(Ice::Int, const std::string &, const Ice::Current &) override;
    virtual Ice::Int removeCamera(Ice::Int, const Ice::Current &) override;
    virtual Ice::Int removeAll(const Ice::Current &) override;
    virtual Ice::Int getMaxCamCount(const Ice::Current &) override;
    virtual Ice::Int getCurrentCamCount(const Ice::Current &) override;
    int addVedio(int index, std::string path, string state);
 
private:
    std::map<int, AppPipeController*> controllers;
    std::atomic<int> currentCount;
    int maxCount;
    // StructureApp interface
public:
    virtual string getRtmp(Ice::Int, const Ice::Current &) override;
};
 
 
 
 
 
 
 
 
 
 
 
 
 
#endif // STRUCTUREAPPI_H