[Local]:2nd step for blocking sequence
[apps/agl-service-windowmanager.git] / src / allocate_queue.hpp
1 /*
2  * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef ALLOCATE_LIST_HPP
18 #define ALLOCATE_LIST_HPP
19 #include <vector>
20 #include "windowmanager-client.hpp"
21
22 namespace wm {
23
24 class  AllocateRequestList {
25 public:
26     AllocateRequestList();
27     ~AllocateRequestList();
28     AllocateRequestList(const AllocateRequestList &obj) = delete;
29
30     typedef std::function<void(const WMClient *)> onEndDraw;
31     typedef std::function<void(const WMClient *)> onReverted;
32
33     // Client Database Interface
34     void addClient(WMClient* client);
35     WMClient* loopUpClient(const char* appid);
36
37     // Request Interface
38     bool hasRequestingApp(const char *appid);
39     void revertRequestingState();
40     void removeAllRequesting();
41     bool addRequest(WMClient *, onEndDraw, onReverted);
42
43     //void revertRequestingState();//???
44
45     /* bool queue(int request_num);
46     bool pushTop(int request_num);
47     bool dequeue();
48     void deleteAllElement();
49     void removeElement(int request_num);
50     bool hasElement(int request_num); */
51
52 private:
53     std::vector<WMClient *> requestQueue;
54
55 };
56
57 }
58 #endif // ALLOCATE_LIST_HPP