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 #include "BundleInfoInternal.h"
28 BundleInfoInternal::BundleInfoInternal()
30 m_activator = nullptr;
31 m_deactivator = nullptr;
32 m_resourceCreator = nullptr;
33 m_resourceDestroyer = nullptr;
34 m_bundleHandle = nullptr;
39 m_java_bundle = false;
43 BundleInfoInternal::~BundleInfoInternal()
45 m_activator = nullptr;
46 m_deactivator = nullptr;
47 m_resourceCreator = nullptr;
48 m_resourceDestroyer = nullptr;
49 m_bundleHandle = nullptr;
52 void BundleInfoInternal::setID(const std::string &id)
57 const std::string &BundleInfoInternal::getID()
62 void BundleInfoInternal::setPath( const std::string &path)
66 const std::string &BundleInfoInternal::getPath()
71 void BundleInfoInternal::setVersion( const std::string &version)
76 const std::string &BundleInfoInternal::getVersion()
81 void BundleInfoInternal::setLoaded(bool loaded)
86 bool BundleInfoInternal::isLoaded()
91 void BundleInfoInternal::setActivated(bool activated)
93 m_activated = activated;
96 bool BundleInfoInternal::isActivated()
101 void BundleInfoInternal::setBundleActivator(activator_t *activator)
103 m_activator = activator;
106 activator_t *BundleInfoInternal::getBundleActivator()
111 void BundleInfoInternal::setBundleDeactivator(deactivator_t *deactivator)
113 m_deactivator = deactivator;
116 deactivator_t *BundleInfoInternal::getBundleDeactivator()
118 return m_deactivator;
121 void BundleInfoInternal::setResourceCreator(resourceCreator_t *resourceCreator)
123 m_resourceCreator = resourceCreator;
126 resourceCreator_t *BundleInfoInternal::getResourceCreator()
128 return m_resourceCreator;
131 void BundleInfoInternal::setResourceDestroyer(resourceDestroyer_t *resourceDestroyer)
133 m_resourceDestroyer = resourceDestroyer;
136 resourceDestroyer_t *BundleInfoInternal::getResourceDestroyer()
138 return m_resourceDestroyer;
141 void BundleInfoInternal::setBundleHandle(void *handle)
143 m_bundleHandle = handle;
146 void *BundleInfoInternal::getBundleHandle()
148 return m_bundleHandle;
151 void BundleInfoInternal::setJavaBundle(bool javaBundle)
153 m_java_bundle = javaBundle;
156 bool BundleInfoInternal::getJavaBundle()
158 return m_java_bundle;
161 void BundleInfoInternal::setSoBundle(bool soBundle)
163 m_so_bundle = soBundle;
166 bool BundleInfoInternal::getSoBundle()
171 void BundleInfoInternal::setActivatorName( const std::string &activatorName)
173 m_activator_name = activatorName;
176 const std::string &BundleInfoInternal::getActivatorName()
178 return m_activator_name;
181 void BundleInfoInternal::setLibraryPath( const std::string &libpath)
183 m_library_path = libpath;
186 const std::string &BundleInfoInternal::getLibraryPath()
188 return m_library_path;
192 void BundleInfoInternal::setJavaBundleActivatorMethod(jmethodID javaBundleActivator)
194 m_java_activator = javaBundleActivator;
197 jmethodID BundleInfoInternal::getJavaBundleActivatorMethod()
199 return m_java_activator;
202 void BundleInfoInternal::setJavaBundleDeactivatorMethod(jmethodID javaBundleActivator)
204 m_java_deactivator = javaBundleActivator;
207 jmethodID BundleInfoInternal::getJavaBundleDeactivatorMethod()
209 return m_java_deactivator;
212 void BundleInfoInternal::setJavaBundleActivatorObject(jobject activator_object)
214 m_java_activator_object = activator_object;
217 jobject BundleInfoInternal::getJavaBundleActivatorObject()
219 return m_java_activator_object;
223 void BundleInfoInternal::setBundleInfo(shared_ptr<RCSBundleInfo> bundleInfo)
225 shared_ptr<BundleInfoInternal> source =
226 std::static_pointer_cast<BundleInfoInternal>(bundleInfo);
228 m_ID = source->getID();
229 m_path = source->getPath();
230 m_version = source->getVersion();
231 m_loaded = source->isLoaded();
232 m_activated = source->isActivated();
233 m_java_bundle = source->getJavaBundle();
234 m_activator = source->getBundleActivator();
235 m_bundleHandle = source->getBundleHandle();
236 m_activator_name = source->getActivatorName();