Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
8d075bbd
Commit
8d075bbd
authored
Sep 22, 2017
by
Ronan
Browse files
feat(c-wrapper): set/get UserData are simple functions now
parent
ce0f9d1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/c-wrapper/internal/c-tools.h
View file @
8d075bbd
...
...
@@ -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
);
}
// ---------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment