Correcting the INPUT in Doxygen file.
[platform/upstream/iotivity.git] / service / resource-encapsulation / src / resourceContainer / include / BundleInfoInternal.h
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 #ifndef BUNDLEINFOINTERNAL_H_
22 #define BUNDLEINFOINTERNAL_H_
23
24 #include <string>
25 #include "RCSBundleInfo.h"
26 #include "ResourceContainerBundleAPI.h"
27
28 #if (JAVA_SUPPORT)
29 #include "jni.h"
30 #endif
31
32 using namespace std;
33 using namespace OIC::Service;
34
35 namespace OIC
36 {
37     namespace Service
38     {
39         typedef void activator_t(ResourceContainerBundleAPI *, std::string bundleId);
40         typedef void deactivator_t(void);
41         typedef void resourceCreator_t(resourceInfo resourceInfo);
42         typedef void resourceDestroyer_t(BundleResource::Ptr pBundleResource);
43
44         class BundleInfoInternal: public RCSBundleInfo
45         {
46             public:
47                 BundleInfoInternal();
48                 BundleInfoInternal(RCSBundleInfo *info);
49                 virtual ~BundleInfoInternal();
50                 void setID(const std::string &id);
51                 const std::string &getID();
52                 void setPath(const std::string &path);
53                 const std::string &getPath();
54                 void setVersion(const std::string &version);
55                 const std::string &getVersion();
56
57                 void setLoaded(bool loaded);
58                 bool isLoaded();
59                 void setActivated(bool activated);
60                 bool isActivated();
61
62                 virtual void setLibraryPath(const std::string &libpath);
63                 virtual const std::string &getLibraryPath();
64
65                 void setActivatorName(const std::string &activatorName);
66                 const std::string &getActivatorName();
67
68                 void setBundleActivator(activator_t *);
69                 activator_t *getBundleActivator();
70
71                 void setBundleDeactivator(deactivator_t *);
72                 deactivator_t *getBundleDeactivator();
73
74                 void setResourceCreator(resourceCreator_t *);
75                 resourceCreator_t *getResourceCreator();
76
77                 void setResourceDestroyer(resourceDestroyer_t *);
78                 resourceDestroyer_t *getResourceDestroyer();
79
80                 void setBundleInfo(RCSBundleInfo *bundleInfo);
81
82                 void setBundleHandle(void *);
83                 void *getBundleHandle();
84
85                 void setJavaBundle(bool javaBundle);
86                 bool getJavaBundle();
87
88 #if (JAVA_SUPPORT)
89                 void setJavaBundleActivatorMethod(jmethodID activator);
90                 jmethodID getJavaBundleActivatorMethod();
91                 void setJavaBundleDeactivatorMethod(jmethodID deactivator);
92                 jmethodID getJavaBundleDeactivatorMethod();
93
94                 void setJavaBundleActivatorObject(jobject);
95                 jobject getJavaBundleActivatorObject();
96 #endif
97
98             private:
99                 bool m_loaded, m_activated, m_java_bundle;
100                 int m_id;
101                 activator_t *m_activator;
102                 deactivator_t *m_deactivator;
103                 resourceCreator_t *m_resourceCreator;
104                 resourceDestroyer_t *m_resourceDestroyer;
105                 void *m_bundleHandle;
106                 string m_activator_name;
107                 string m_library_path;
108 #if (JAVA_SUPPORT)
109                 jmethodID m_java_activator, m_java_deactivator;
110                 jobject m_java_activator_object;
111 #endif
112
113         };
114     }
115 }
116
117 #endif /* BUNDLEINFOINTERNAL_H_ */