Commit 0579b0db authored by Ronan's avatar Ronan
Browse files

feat(General): provide a L_Q_T macro to access public data in a multiple inheritance case

parent 42b51aaa
......@@ -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);
}
// =============================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment