Commit 1ca9d64a authored by Ronan's avatar Ronan

feat(core): avoid virtual inheritance of CoreAccessor

parent 6dd6e829
......@@ -30,13 +30,13 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
BasicChatRoom::BasicChatRoom (const shared_ptr<Core> &core, const ChatRoomId &chatRoomId) :
BasicChatRoom(*new BasicChatRoomPrivate, core, chatRoomId) {}
ChatRoom(*new BasicChatRoomPrivate, core, chatRoomId) {}
BasicChatRoom::BasicChatRoom (
BasicChatRoomPrivate &p,
const std::shared_ptr<Core> &core,
const ChatRoomId &chatRoomId
) : CoreAccessor(core), ChatRoom(p, core, chatRoomId) {}
) : ChatRoom(p, core, chatRoomId) {}
BasicChatRoom::CapabilitiesMask BasicChatRoom::getCapabilities () const {
return static_cast<CapabilitiesMask>(Capabilities::Basic);
......
......@@ -449,7 +449,7 @@ void ChatRoomPrivate::onIsComposingRefreshNeeded () {
// =============================================================================
ChatRoom::ChatRoom (ChatRoomPrivate &p, const shared_ptr<Core> &core, const ChatRoomId &chatRoomId) :
CoreAccessor(core), Object(p) {
Object(p), CoreAccessor(core) {
L_D();
d->chatRoomId = chatRoomId;
......
......@@ -30,7 +30,7 @@ LINPHONE_BEGIN_NAMESPACE
class ChatRoomPrivate;
class LINPHONE_PUBLIC ChatRoom : public Object, virtual public CoreAccessor, public ConferenceInterface {
class LINPHONE_PUBLIC ChatRoom : public Object, public CoreAccessor, public ConferenceInterface {
friend class Core;
friend class CorePrivate;
friend class ChatMessage;
......
......@@ -81,14 +81,17 @@ ClientGroupChatRoom::ClientGroupChatRoom (
const std::string &factoryUri,
const IdentityAddress &me,
const std::string &subject
) : CoreAccessor(core),
ChatRoom(*new ClientGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(), me)),
) : ChatRoom(*new ClientGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(), me)),
RemoteConference(core, me, nullptr) {
L_D_T(RemoteConference, dConference);
dConference->focus = make_shared<Participant>(Address(factoryUri));
RemoteConference::setSubject(subject);
}
shared_ptr<Core> ClientGroupChatRoom::getCore () const {
return ChatRoom::getCore();
}
ClientGroupChatRoom::CapabilitiesMask ClientGroupChatRoom::getCapabilities () const {
return static_cast<CapabilitiesMask>(Capabilities::Conference);
}
......
......@@ -39,6 +39,8 @@ public:
const std::string &subject
);
std::shared_ptr<Core> getCore () const;
CapabilitiesMask getCapabilities () const override;
const Address &getConferenceAddress () const override;
......
......@@ -104,7 +104,7 @@ void RealTimeTextChatRoomPrivate::sendMessage (const shared_ptr<ChatMessage> &ms
// =============================================================================
RealTimeTextChatRoom::RealTimeTextChatRoom (const shared_ptr<Core> &core, const ChatRoomId &chatRoomId) :
CoreAccessor(core), BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, chatRoomId) {}
BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, chatRoomId) {}
RealTimeTextChatRoom::CapabilitiesMask RealTimeTextChatRoom::getCapabilities () const {
return BasicChatRoom::getCapabilities() | static_cast<CapabilitiesMask>(Capabilities::RealTimeText);
......
......@@ -77,7 +77,7 @@ bool ServerGroupChatRoomPrivate::isAdminLeft () const {
// =============================================================================
ServerGroupChatRoom::ServerGroupChatRoom (const shared_ptr<Core> &core, SalCallOp *op) : CoreAccessor(core),
ServerGroupChatRoom::ServerGroupChatRoom (const shared_ptr<Core> &core, SalCallOp *op) :
ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))),
LocalConference(core, Address(op->get_to()), nullptr) {}
......
......@@ -37,7 +37,7 @@ class ConferencePrivate;
class LINPHONE_PUBLIC Conference :
public ConferenceInterface,
public CallSessionListener,
virtual public CoreAccessor {
public CoreAccessor {
friend class CallSessionPrivate;
public:
......
......@@ -29,7 +29,7 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
LocalConference::LocalConference (const shared_ptr<Core> &core, const Address &myAddress, CallListener *listener)
: CoreAccessor(core), Conference(*new LocalConferencePrivate, core, myAddress, listener) {
: Conference(*new LocalConferencePrivate, core, myAddress, listener) {
L_D();
d->eventHandler.reset(new LocalConferenceEventHandler(this));
}
......
......@@ -32,7 +32,7 @@ RemoteConference::RemoteConference (
const shared_ptr<Core> &core,
const Address &myAddress,
CallListener *listener
) : CoreAccessor(core), Conference(*new RemoteConferencePrivate, core, myAddress, listener) {
) : Conference(*new RemoteConferencePrivate, core, myAddress, listener) {
L_D();
d->eventHandler.reset(new RemoteConferenceEventHandler(this));
}
......
This diff is collapsed.
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