mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Automatically generate Core creation method for C++ wrapper.
This commit is contained in:
parent
511a4d3099
commit
702e257cae
4 changed files with 0 additions and 55 deletions
|
|
@ -118,7 +118,6 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_2
|
|||
* @param[in] system_context A pointer to a system object required by the core to operate. Currently it is required to
|
||||
* pass an android Context on android, pass NULL on other platforms.
|
||||
* @see linphone_core_new_with_config_3
|
||||
* @deprecated 2018-01-10: Use linphone_factory_create_core_3() instead
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_3 (
|
||||
const LinphoneFactory *factory,
|
||||
|
|
@ -180,7 +179,6 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_w
|
|||
* @param[in] system_context A pointer to a system object required by the core to operate. Currently it is required to
|
||||
* pass an android Context on android, pass NULL on other platforms.
|
||||
* @see linphone_factory_create_core_3
|
||||
* @deprecated 2018-01-10: Use linphone_factory_create_core_with_config_3() instead
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_with_config_3 (
|
||||
const LinphoneFactory *factory,
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
{{/includes}}
|
||||
#include "object.hh"
|
||||
|
||||
{{#_class}}{{#isfactory}}
|
||||
#include "config.hh"
|
||||
{{/isfactory}}{{/_class}}
|
||||
|
||||
{{#_class}}{{#isVcard}}
|
||||
namespace belcard {
|
||||
class BelCard;
|
||||
|
|
@ -98,10 +94,6 @@ namespace linphone {
|
|||
{{/ismultilistenable}}
|
||||
|
||||
public:
|
||||
{{#isfactory}}
|
||||
LINPHONECXX_PUBLIC std::shared_ptr<Core> createCore(const std::shared_ptr<CoreListener> &listener, const std::string & configPath, const std::string & factoryConfigPath) const;
|
||||
LINPHONECXX_PUBLIC std::shared_ptr<Core> createCoreWithConfig(const std::shared_ptr<CoreListener> &listener, const std::shared_ptr<Config> & config) const;
|
||||
{{/isfactory}}
|
||||
{{#isVcard}}
|
||||
LINPHONECXX_PUBLIC std::shared_ptr<belcard::BelCard> &getVcard();
|
||||
{{/isVcard}}
|
||||
|
|
|
|||
|
|
@ -117,50 +117,6 @@ void *{{{className}}}::createCallbacks(void *userData) {
|
|||
}
|
||||
{{/ismultilistenable}}
|
||||
|
||||
{{#isfactory}}
|
||||
std::shared_ptr<Core> Factory::createCore(const std::shared_ptr<CoreListener> & listener, const std::string & configPath, const std::string & factoryConfigPath) const {
|
||||
::LinphoneCoreCbs *cbs = NULL;
|
||||
std::list<std::shared_ptr<Listener> > listeners;
|
||||
if (listener != nullptr) {
|
||||
listeners.push_back(std::static_pointer_cast<Listener,CoreListener>(listener));
|
||||
cbs = (::LinphoneCoreCbs *)Core::createCallbacks(&listeners);
|
||||
}
|
||||
|
||||
::LinphoneFactory *factory = linphone_factory_get();
|
||||
::LinphoneCore *core_ptr = linphone_factory_create_core(factory, cbs, StringUtilities::cppStringToC(configPath), StringUtilities::cppStringToC(factoryConfigPath));
|
||||
|
||||
if (cbs != NULL) {
|
||||
linphone_core_remove_callbacks(core_ptr, cbs);
|
||||
linphone_core_cbs_unref(cbs);
|
||||
}
|
||||
|
||||
std::shared_ptr<Core> cppCore = cPtrToSharedPtr<Core>((::belle_sip_object_t *)core_ptr, false);
|
||||
if (listener != nullptr) cppCore->addListener(listener);
|
||||
return cppCore;
|
||||
}
|
||||
|
||||
std::shared_ptr<Core> Factory::createCoreWithConfig(const std::shared_ptr<CoreListener> & listener, const std::shared_ptr<Config> & config) const {
|
||||
::LinphoneCoreCbs *cbs = NULL;
|
||||
std::list<std::shared_ptr<Listener> > listeners;
|
||||
if (listener != nullptr) {
|
||||
listeners.push_back(std::static_pointer_cast<Listener,CoreListener>(listener));
|
||||
cbs = (::LinphoneCoreCbs *)Core::createCallbacks(&listeners);
|
||||
}
|
||||
|
||||
::LinphoneFactory *factory = linphone_factory_get();
|
||||
::LinphoneCore *core_ptr = linphone_factory_create_core_with_config(factory, cbs, (::LinphoneConfig *)sharedPtrToCPtr(config));
|
||||
|
||||
if (cbs != NULL) {
|
||||
linphone_core_remove_callbacks(core_ptr, cbs);
|
||||
linphone_core_cbs_unref(cbs);
|
||||
}
|
||||
|
||||
std::shared_ptr<Core> cppCore = cPtrToSharedPtr<Core>((::belle_sip_object_t *)core_ptr, false);
|
||||
if (listener != nullptr) cppCore->addListener(listener);
|
||||
return cppCore;
|
||||
}
|
||||
{{/isfactory}}
|
||||
|
||||
{{#isVcard}}
|
||||
std::shared_ptr<belcard::BelCard> &Vcard::getVcard() {
|
||||
return *(shared_ptr<belcard::BelCard> *)linphone_vcard_get_belcard((LinphoneVcard *)mPrivPtr);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ class CppTranslator(object):
|
|||
'isnotrefcountable' : not _class.refcountable,
|
||||
'isNotListener' : True,
|
||||
'isListener' : False,
|
||||
'isfactory' : (_class.name.to_c() == 'LinphoneFactory'),
|
||||
'isVcard' : (_class.name.to_c() == 'LinphoneVcard'),
|
||||
'className' : _class.name.translate(self.nameTranslator),
|
||||
'cClassName' : '::' + _class.name.to_c(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue