1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
11 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef BUNDLEINFOINTERNAL_H_
22 #define BUNDLEINFOINTERNAL_H_
25 #include "BundleInfo.h"
26 #include "ResourceContainerBundleAPI.h"
30 using namespace OIC::Service;
36 typedef void activator_t(ResourceContainerBundleAPI *, std::string bundleId);
37 typedef void deactivator_t(void);
38 typedef void resourceCreator_t(resourceInfo resourceInfo);
39 typedef void resourceDestroyer_t(BundleResource *pBundleResource);
41 class BundleInfoInternal: public BundleInfo
45 BundleInfoInternal(BundleInfo *info);
46 virtual ~BundleInfoInternal();
47 void setID(string id);
49 void setPath(string path);
51 void setVersion(string version);
54 void setLoaded(bool loaded);
56 void setActivated(bool activated);
59 virtual void setLibraryPath(string libpath);
60 virtual string getLibraryPath();
62 void setActivatorName(string activatorName);
63 string getActivatorName();
65 void setJavaBundleActivatorMethod(jmethodID activator);
66 jmethodID getJavaBundleActivatorMethod();
67 void setJavaBundleDeactivatorMethod(jmethodID deactivator);
68 jmethodID getJavaBundleDeactivatorMethod();
70 void setJavaBundleActivatorObject(jobject);
71 jobject getJavaBundleActivatorObject();
73 void setBundleActivator(activator_t *);
74 activator_t *getBundleActivator();
76 void setBundleDeactivator(deactivator_t *);
77 deactivator_t *getBundleDeactivator();
79 void setResourceCreator(resourceCreator_t *);
80 resourceCreator_t *getResourceCreator();
82 void setResourceDestroyer(resourceDestroyer_t *);
83 resourceDestroyer_t *getResourceDestroyer();
85 void setBundleHandle(void *);
86 void *getBundleHandle();
88 void setJavaBundle(bool javaBundle);
91 void setBundleInfo(BundleInfo *bundleInfo);
94 bool m_loaded, m_activated, m_java_bundle;
96 activator_t *m_activator;
97 deactivator_t *m_deactivator;
98 resourceCreator_t *m_resourceCreator;
99 resourceDestroyer_t *m_resourceDestroyer;
100 void *m_bundleHandle;
101 string m_activator_name;
102 jmethodID m_java_activator, m_java_deactivator;
103 jobject m_java_activator_object;
104 string m_library_path;
109 #endif /* BUNDLEINFOINTERNAL_H_ */