mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
feat(General): provide a L_Q_T macro to access public data in a multiple inheritance case
This commit is contained in:
parent
42b51aaaf3
commit
0579b0db2b
2 changed files with 13 additions and 3 deletions
|
|
@ -180,6 +180,15 @@ struct AddConstMirror<const T, U> {
|
|||
>::type * \
|
||||
>(CLASS::mPrivate);
|
||||
|
||||
// Get Private data of class in a multiple inheritance case.
|
||||
#define L_Q_T(CLASS, NAME) \
|
||||
auto const NAME = static_cast< \
|
||||
AddConstMirror< \
|
||||
std::remove_reference<decltype(*this)>::type, \
|
||||
CLASS \
|
||||
>::type * \
|
||||
>(getPublic());
|
||||
|
||||
#define L_OVERRIDE_SHARED_FROM_THIS(CLASS) \
|
||||
inline std::shared_ptr<CLASS> getSharedFromThis () { \
|
||||
return std::static_pointer_cast<CLASS>(Object::getSharedFromThis()); \
|
||||
|
|
|
|||
|
|
@ -41,11 +41,12 @@ ClientGroupChatRoomPrivate::ClientGroupChatRoomPrivate (LinphoneCore *core) : Ch
|
|||
|
||||
shared_ptr<CallSession> ClientGroupChatRoomPrivate::createSession () {
|
||||
L_Q();
|
||||
L_Q_T(RemoteConference, qConference);
|
||||
|
||||
CallSessionParams csp;
|
||||
csp.addCustomHeader("Require", "recipient-list-invite");
|
||||
|
||||
shared_ptr<Participant> focus = static_cast<RemoteConference *>(q)->getPrivate()->focus;
|
||||
shared_ptr<Participant> focus = qConference->getPrivate()->focus;
|
||||
shared_ptr<CallSession> session = focus->getPrivate()->createSession(*q, &csp, false, q);
|
||||
const Address &myAddress = q->getMe()->getAddress();
|
||||
session->configure(LinphoneCallOutgoing, nullptr, nullptr, myAddress, focus->getAddress());
|
||||
|
|
@ -58,8 +59,8 @@ shared_ptr<CallSession> ClientGroupChatRoomPrivate::createSession () {
|
|||
}
|
||||
|
||||
void ClientGroupChatRoomPrivate::notifyReceived (string body) {
|
||||
L_Q();
|
||||
static_cast<RemoteConference *>(q)->getPrivate()->eventHandler->notifyReceived(body);
|
||||
L_Q_T(RemoteConference, qConference);
|
||||
qConference->getPrivate()->eventHandler->notifyReceived(body);
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue