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 "RCSBundleInfo.h"
26 #include "ResourceContainerBundleAPI.h"
33 using namespace OIC::Service;
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);
44 class BundleInfoInternal: public RCSBundleInfo
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();
57 void setLoaded(bool loaded);
59 void setActivated(bool activated);
62 virtual void setLibraryPath(const std::string &libpath);
63 virtual const std::string &getLibraryPath();
65 void setActivatorName(const std::string &activatorName);
66 const std::string &getActivatorName();
68 void setBundleActivator(activator_t *);
69 activator_t *getBundleActivator();
71 void setBundleDeactivator(deactivator_t *);
72 deactivator_t *getBundleDeactivator();
74 void setResourceCreator(resourceCreator_t *);
75 resourceCreator_t *getResourceCreator();
77 void setResourceDestroyer(resourceDestroyer_t *);
78 resourceDestroyer_t *getResourceDestroyer();
80 void setBundleInfo(RCSBundleInfo *bundleInfo);
82 void setBundleHandle(void *);
83 void *getBundleHandle();
85 void setJavaBundle(bool javaBundle);
89 void setJavaBundleActivatorMethod(jmethodID activator);
90 jmethodID getJavaBundleActivatorMethod();
91 void setJavaBundleDeactivatorMethod(jmethodID deactivator);
92 jmethodID getJavaBundleDeactivatorMethod();
94 void setJavaBundleActivatorObject(jobject);
95 jobject getJavaBundleActivatorObject();
99 bool m_loaded, m_activated, m_java_bundle;
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;
109 jmethodID m_java_activator, m_java_deactivator;
110 jobject m_java_activator_object;
117 #endif /* BUNDLEINFOINTERNAL_H_ */