mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 11:38:08 +00:00
feat(c-wrapper): set/get UserData are simple functions now
This commit is contained in:
parent
ce0f9d1c14
commit
8d075bbd27
1 changed files with 13 additions and 17 deletions
|
|
@ -25,7 +25,7 @@
|
|||
// TODO: From coreapi. Remove me later.
|
||||
#include "private.h"
|
||||
|
||||
#include "variant/variant.h"
|
||||
#include "object/property-container.h"
|
||||
|
||||
// =============================================================================
|
||||
// Internal.
|
||||
|
|
@ -215,28 +215,24 @@ public:
|
|||
// Get/set user data.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
template<typename T>
|
||||
static void *getUserData (const std::shared_ptr<T> &cppPtr) {
|
||||
Variant v = cppPtr->getProperty("LinphonePrivate::Wrapper::userData");
|
||||
return v.getValue<void *>();
|
||||
static inline void *getUserData (const std::shared_ptr<const PropertyContainer> &propertyContainer) {
|
||||
L_ASSERT(propertyContainer);
|
||||
return propertyContainer->getProperty("LinphonePrivate::Wrapper::userData").getValue<void *>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void *getUserData (T *cppPtr) {
|
||||
Variant v = cppPtr->getProperty("LinphonePrivate::Wrapper::userData");
|
||||
return v.getValue<void *>();
|
||||
static inline void *getUserData (const PropertyContainer *propertyContainer) {
|
||||
L_ASSERT(propertyContainer);
|
||||
return propertyContainer->getProperty("LinphonePrivate::Wrapper::userData").getValue<void *>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline void setUserData (const std::shared_ptr<T> &object, void *value) {
|
||||
L_ASSERT(object);
|
||||
object->setProperty("LinphonePrivate::Wrapper::userData", value);
|
||||
static inline void setUserData (const std::shared_ptr<PropertyContainer> &propertyContainer, void *value) {
|
||||
L_ASSERT(propertyContainer);
|
||||
propertyContainer->setProperty("LinphonePrivate::Wrapper::userData", value);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline void setUserData (T *object, void *value) {
|
||||
L_ASSERT(object);
|
||||
object->setProperty("LinphonePrivate::Wrapper::userData", value);
|
||||
static inline void setUserData (PropertyContainer *propertyContainer, void *value) {
|
||||
L_ASSERT(propertyContainer);
|
||||
propertyContainer->setProperty("LinphonePrivate::Wrapper::userData", value);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue