tizen 2.4 release
[framework/context/context-service.git] / src / context_trigger / clips_handler.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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 __CLIPS_HANDLER_H__
18 #define __CLIPS_HANDLER_H__
19
20 namespace ctx {
21
22         class json;
23         class rule_manager;
24
25         class clips_handler {
26                 public:
27                         clips_handler(ctx::rule_manager* rm);
28                         ~clips_handler();
29
30                         int define_template(std::string& script);
31                         int define_class(std::string& script);
32                         int define_rule(std::string& script);
33                         int run_environment();
34                         int add_fact(std::string& fact);
35                         int route_string_command(std::string& fact);
36                         int make_instance(std::string& script);
37                         int unmake_instance(std::string& instance_name);
38                         static int execute_action(void);
39                         bool find_instance(std::string& instance_name);
40                         bool define_global_variable_string(std::string variable_name, std::string value);
41                         bool set_global_variable_string(std::string variable_name, std::string value);
42
43                 private:
44                         clips_handler();
45                         int init_environment(void);
46                         int env_build(std::string& script);
47                         void* find_instance_internal(std::string& instance_name);
48
49    };   /* class clips_handler */
50
51 }       /* namespace ctx */
52
53 #endif  /* End of __CLIPS_HANDLER_H__ */