Dali 3D User Interface Engine
test-trace-call-stack.h
Go to the documentation of this file.
1 #ifndef __TEST_TRACE_CALL_STACK_H__
2 #define __TEST_TRACE_CALL_STACK_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 #include <string>
22 #include <vector>
23 
24 namespace Dali
25 {
26 
30 class TraceCallStack
31 {
32 public:
37 
42 
46  void Enable(bool enable);
47 
48  bool IsEnabled();
49 
55  void PushCall(std::string method, std::string params);
56 
57 
63  bool FindMethod(std::string method) const;
64 
70  int CountMethod(std::string method) const;
71 
78  bool FindMethodAndParams(std::string method, std::string params) const;
79 
86  int FindIndexFromMethodAndParams(std::string method, std::string params) const;
87 
94  bool TestMethodAndParams(int index, std::string method, std::string params) const;
95 
99  void Reset();
100 
105  inline const std::vector< std::vector< std::string > >& GetCallStack() { return mCallStack; }
106 
107 private:
108  bool mTraceActive;
109  std::vector< std::vector< std::string > > mCallStack;
110 };
111 
112 } // namespace dali
113 
114 #endif //__TEST_TRACE_CALL_STACK_H__
Dali Docs Home
Read more about Dali