Commit 2941e64e authored by Ronan's avatar Ronan

feat(Core): provide a low-level BaseObject

parent d160e5ab
......@@ -29,7 +29,6 @@
#endif // ifdef __cplusplus
LINPHONE_PUBLIC LinphoneEventLog *linphone_event_log_new (void);
LINPHONE_PUBLIC LinphoneEventLog *linphone_event_log_clone (const LinphoneEventLog *event_log);
LINPHONE_PUBLIC LinphoneEventLog *linphone_event_log_ref (LinphoneEventLog *event_log);
LINPHONE_PUBLIC LinphoneEventLogType linphone_event_log_get_type (const LinphoneEventLog *event_log);
......@@ -38,7 +37,6 @@ LINPHONE_PUBLIC LinphoneCallEvent *linphone_call_event_new (
time_t time,
LinphoneCall *call
);
LINPHONE_PUBLIC LinphoneCallEvent *linphone_call_event_clone (const LinphoneCallEvent *call_event);
LINPHONE_PUBLIC LinphoneCall *linphone_call_event_get_call (const LinphoneCallEvent *call_event);
LINPHONE_PUBLIC LinphoneConferenceEvent *linphone_conference_event_new (
......@@ -46,7 +44,6 @@ LINPHONE_PUBLIC LinphoneConferenceEvent *linphone_conference_event_new (
time_t time,
const LinphoneAddress *address
);
LINPHONE_PUBLIC LinphoneConferenceEvent *linphone_conference_event_clone (const LinphoneConferenceEvent *conference_event);
LINPHONE_PUBLIC const LinphoneAddress *linphone_conference_event_get_address (const LinphoneConferenceEvent *conference_event);
LINPHONE_PUBLIC LinphoneConferenceParticipantEvent *linphone_conference_participant_event_new (
......@@ -55,9 +52,6 @@ LINPHONE_PUBLIC LinphoneConferenceParticipantEvent *linphone_conference_particip
const LinphoneAddress *conferenceAddress,
const LinphoneAddress *participantAddress
);
LINPHONE_PUBLIC LinphoneConferenceParticipantEvent *linphone_conference_participant_event_clone (
const LinphoneConferenceParticipantEvent *conference_participant_event
);
LINPHONE_PUBLIC const LinphoneAddress *linphone_conference_participant_event_get_participant_address (
const LinphoneConferenceParticipantEvent *conference_participant_event
);
......@@ -66,9 +60,6 @@ LINPHONE_PUBLIC LinphoneChatMessageEvent *linphone_chat_message_event_new (
LinphoneChatMessage *chat_message,
time_t time
);
LINPHONE_PUBLIC LinphoneChatMessageEvent *linphone_chat_message_event_clone (
const LinphoneChatMessageEvent *chat_message_event
);
LINPHONE_PUBLIC LinphoneChatMessage *linphone_chat_message_event_get_chat_message (
const LinphoneChatMessageEvent *chat_message_event
);
......
......@@ -82,27 +82,42 @@ void l_assert (const char *condition, const char *file, int line);
#define L_UNLIKELY(EXPRESSION) EXPRESSION
#endif
class BaseObject;
class BaseObjectPrivate;
class ClonableObject;
class ClonableObjectPrivate;
class Object;
class ObjectPrivate;
#define L_INTERNAL_DECLARE_PRIVATE(CLASS) \
inline CLASS ## Private *getPrivate() { \
return reinterpret_cast<CLASS ## Private *>(mPrivate); \
} \
inline const CLASS ## Private *getPrivate() const { \
return reinterpret_cast<const CLASS ## Private *>(mPrivate); \
} \
friend class CLASS ## Private; \
friend class Wrapper;
#define L_INTERNAL_CHECK_OBJECT_INHERITANCE(CLASS) \
static_assert( \
!(std::is_base_of<BaseObject, CLASS>::value && std::is_base_of<ClonableObject, CLASS>::value), \
"Multiple inheritance between BaseObject and ClonableObject is not allowed." \
);
#define L_INTERNAL_GET_BETTER_PRIVATE_ANCESTOR(CLASS) \
std::conditional< \
std::is_base_of<BaseObject, CLASS>::value, \
BaseObject, \
std::conditional< \
std::is_base_of<ClonableObject, CLASS>::value, \
ClonableObject, \
CLASS \
>::type \
>::type
#define L_INTERNAL_DECLARE_PRIVATE_T(CLASS, PARENT_TYPE) \
inline CLASS ## Private *getPrivate() { \
return reinterpret_cast<CLASS ## Private *>(PARENT_TYPE::mPrivate); \
#define L_INTERNAL_DECLARE_PRIVATE(CLASS) \
inline CLASS ## Private *getPrivate () { \
L_INTERNAL_CHECK_OBJECT_INHERITANCE(CLASS); \
return reinterpret_cast<CLASS ## Private *>( \
L_INTERNAL_GET_BETTER_PRIVATE_ANCESTOR(CLASS)::mPrivate \
); \
} \
inline const CLASS ## Private *getPrivate() const { \
return reinterpret_cast<const CLASS ## Private *>(PARENT_TYPE::mPrivate); \
inline const CLASS ## Private *getPrivate () const { \
L_INTERNAL_CHECK_OBJECT_INHERITANCE(CLASS); \
return reinterpret_cast<const CLASS ## Private *>( \
L_INTERNAL_GET_BETTER_PRIVATE_ANCESTOR(CLASS)::mPrivate \
); \
} \
friend class CLASS ## Private; \
friend class Wrapper;
......@@ -111,17 +126,13 @@ class ObjectPrivate;
// Gives a control to C Wrapper.
#ifndef LINPHONE_TESTER
#define L_DECLARE_PRIVATE(CLASS) L_INTERNAL_DECLARE_PRIVATE(CLASS)
#define L_DECLARE_PRIVATE_T(CLASS, PARENT_TYPE) L_INTERNAL_DECLARE_PRIVATE_T(CLASS, PARENT_TYPE)
#else
#define L_DECLARE_PRIVATE(CLASS) \
L_INTERNAL_DECLARE_PRIVATE(CLASS) \
friend class Tester;
#define L_DECLARE_PRIVATE_T(CLASS, PARENT_TYPE) \
L_INTERNAL_DECLARE_PRIVATE_T(CLASS, PARENT_TYPE) \
friend class Tester;
#endif
// Generic public helper. (Neither ClonableObject nor Object.)
// Generic public helper. (Neither ClonableObject.)
// `void *` is used to avoid downcasting.
template<typename T>
constexpr T *getPublicHelper (void *object, const void *) {
......@@ -135,11 +146,6 @@ inline T *getPublicHelper (const U *map, const ClonableObjectPrivate *context) {
return static_cast<T *>(it->second);
}
template<typename T>
constexpr T *getPublicHelper (Object *object, const ObjectPrivate *) {
return static_cast<T *>(object);
}
#define L_DECLARE_PUBLIC(CLASS) \
inline CLASS *getPublic () { \
L_ASSERT(mPublic); \
......
......@@ -111,8 +111,12 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
nat/ice-agent.h
nat/stun-client.h
object/app-data-container.h
object/base-object-p.h
object/base-object.h
object/clonable-object-p.h
object/clonable-object.h
object/object-head-p.h
object/object-head.h
object/object-p.h
object/object.h
object/property-container.h
......@@ -191,6 +195,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
nat/ice-agent.cpp
nat/stun-client.cpp
object/app-data-container.cpp
object/base-object.cpp
object/clonable-object.cpp
object/object.cpp
object/property-container.cpp
......
......@@ -22,7 +22,7 @@
// =============================================================================
L_DECLARE_C_CLONABLE_STRUCT_IMPL(Address);
L_DECLARE_C_CLONABLE_OBJECT_IMPL(Address);
using namespace std;
......
......@@ -23,7 +23,7 @@
// =============================================================================
L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallParams)
L_DECLARE_C_CLONABLE_OBJECT_IMPL(CallParams)
using namespace std;
......
......@@ -27,13 +27,13 @@
// =============================================================================
L_DECLARE_C_CLONABLE_STRUCT_IMPL(EventLog);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceParticipantEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceParticipantDeviceEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceSubjectEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ChatMessageEvent);
L_DECLARE_C_BASE_OBJECT_IMPL(EventLog);
L_DECLARE_C_BASE_OBJECT_IMPL(CallEvent);
L_DECLARE_C_BASE_OBJECT_IMPL(ConferenceEvent);
L_DECLARE_C_BASE_OBJECT_IMPL(ConferenceParticipantEvent);
L_DECLARE_C_BASE_OBJECT_IMPL(ConferenceParticipantDeviceEvent);
L_DECLARE_C_BASE_OBJECT_IMPL(ConferenceSubjectEvent);
L_DECLARE_C_BASE_OBJECT_IMPL(ChatMessageEvent);
using namespace std;
......
This diff is collapsed.
......@@ -69,7 +69,7 @@ private:
void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) override;
private:
L_DECLARE_PRIVATE_T(ClientGroupChatRoom, ChatRoom);
L_DECLARE_PRIVATE(ClientGroupChatRoom);
L_DISABLE_COPY(ClientGroupChatRoom);
};
......
......@@ -64,7 +64,7 @@ public:
bool isEmpty () const;
private:
L_DECLARE_PRIVATE_T(Content, ClonableObject);
L_DECLARE_PRIVATE(Content);
};
LINPHONE_END_NAMESPACE
......
......@@ -41,18 +41,6 @@ CallEvent::CallEvent (Type type, time_t time, const shared_ptr<Call> &call) :
d->call = call;
}
CallEvent::CallEvent (const CallEvent &src) : CallEvent(src.getType(), src.getTime(), src.getCall()) {}
CallEvent &CallEvent::operator= (const CallEvent &src) {
L_D();
if (this != &src) {
EventLog::operator=(src);
d->call = src.getPrivate()->call;
}
return *this;
}
shared_ptr<Call> CallEvent::getCall () const {
L_D();
return d->call;
......
......@@ -34,14 +34,12 @@ class CallEventPrivate;
class LINPHONE_PUBLIC CallEvent : public EventLog {
public:
CallEvent (Type type, std::time_t time, const std::shared_ptr<Call> &message);
CallEvent (const CallEvent &src);
CallEvent &operator= (const CallEvent &src);
std::shared_ptr<Call> getCall () const;
private:
L_DECLARE_PRIVATE(CallEvent);
L_DISABLE_COPY(CallEvent);
};
LINPHONE_END_NAMESPACE
......
......@@ -42,20 +42,6 @@ ChatMessageEvent::ChatMessageEvent (
d->chatMessage = chatMessage;
}
ChatMessageEvent::ChatMessageEvent (
const ChatMessageEvent &src
) : ChatMessageEvent(src.getTime(), src.getChatMessage()) {}
ChatMessageEvent &ChatMessageEvent::operator= (const ChatMessageEvent &src) {
L_D();
if (this != &src) {
EventLog::operator=(src);
d->chatMessage = src.getPrivate()->chatMessage;
}
return *this;
}
shared_ptr<ChatMessage> ChatMessageEvent::getChatMessage () const {
L_D();
return d->chatMessage;
......
......@@ -34,14 +34,12 @@ class ChatMessageEventPrivate;
class LINPHONE_PUBLIC ChatMessageEvent : public EventLog {
public:
ChatMessageEvent (std::time_t time, const std::shared_ptr<ChatMessage> &chatMessage);
ChatMessageEvent (const ChatMessageEvent &src);
ChatMessageEvent &operator= (const ChatMessageEvent &src);
std::shared_ptr<ChatMessage> getChatMessage () const;
private:
L_DECLARE_PRIVATE(ChatMessageEvent);
L_DISABLE_COPY(ChatMessageEvent);
};
LINPHONE_END_NAMESPACE
......
......@@ -33,9 +33,6 @@ ConferenceEvent::ConferenceEvent (Type type, time_t time, const Address &confere
d->conferenceAddress = conferenceAddress;
}
ConferenceEvent::ConferenceEvent (const ConferenceEvent &src) :
ConferenceEvent(src.getType(), src.getTime(), src.getConferenceAddress()) {}
ConferenceEvent::ConferenceEvent (
ConferenceEventPrivate &p,
Type type,
......@@ -46,16 +43,6 @@ ConferenceEvent::ConferenceEvent (
d->conferenceAddress = conferenceAddress;
}
ConferenceEvent &ConferenceEvent::operator= (const ConferenceEvent &src) {
L_D();
if (this != &src) {
EventLog::operator=(src);
d->conferenceAddress = src.getPrivate()->conferenceAddress;
}
return *this;
}
const Address &ConferenceEvent::getConferenceAddress () const {
L_D();
return d->conferenceAddress;
......
......@@ -32,9 +32,6 @@ class ConferenceEventPrivate;
class LINPHONE_PUBLIC ConferenceEvent : public EventLog {
public:
ConferenceEvent (Type type, std::time_t time, const Address &conferenceAddress);
ConferenceEvent (const ConferenceEvent &src);
ConferenceEvent &operator= (const ConferenceEvent &src);
const Address &getConferenceAddress () const;
......@@ -43,6 +40,7 @@ protected:
private:
L_DECLARE_PRIVATE(ConferenceEvent);
L_DISABLE_COPY(ConferenceEvent);
};
LINPHONE_END_NAMESPACE
......
......@@ -37,15 +37,6 @@ ConferenceNotifiedEvent::ConferenceNotifiedEvent (
d->notifyId = notifyId;
}
ConferenceNotifiedEvent::ConferenceNotifiedEvent (
const ConferenceNotifiedEvent &src
) : ConferenceNotifiedEvent(
src.getType(),
src.getTime(),
src.getConferenceAddress(),
src.getNotifyId()
) {}
ConferenceNotifiedEvent::ConferenceNotifiedEvent (
ConferenceNotifiedEventPrivate &p,
Type type,
......@@ -57,16 +48,6 @@ ConferenceNotifiedEvent::ConferenceNotifiedEvent (
d->notifyId = notifyId;
}
ConferenceNotifiedEvent &ConferenceNotifiedEvent::operator= (const ConferenceNotifiedEvent &src) {
L_D();
if (this != &src) {
ConferenceEvent::operator=(src);
d->notifyId = src.getPrivate()->notifyId;
}
return *this;
}
unsigned int ConferenceNotifiedEvent::getNotifyId () const {
L_D();
return d->notifyId;
......
......@@ -31,9 +31,6 @@ class ConferenceNotifiedEventPrivate;
class LINPHONE_PUBLIC ConferenceNotifiedEvent : public ConferenceEvent {
public:
ConferenceNotifiedEvent (Type type, std::time_t time, const Address &conferenceAddress, unsigned int notifiyId);
ConferenceNotifiedEvent (const ConferenceNotifiedEvent &src);
ConferenceNotifiedEvent &operator= (const ConferenceNotifiedEvent &src);
unsigned int getNotifyId () const;
......@@ -48,6 +45,7 @@ protected:
private:
L_DECLARE_PRIVATE(ConferenceNotifiedEvent);
L_DISABLE_COPY(ConferenceNotifiedEvent);
};
LINPHONE_END_NAMESPACE
......
......@@ -56,28 +56,6 @@ ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent (
d->gruuAddress = gruuAddress;
}
ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent (const ConferenceParticipantDeviceEvent &src) :
ConferenceParticipantDeviceEvent(
src.getType(),
src.getTime(),
src.getConferenceAddress(),
src.getNotifyId(),
src.getParticipantAddress(),
src.getGruuAddress()
) {}
ConferenceParticipantDeviceEvent &ConferenceParticipantDeviceEvent::operator= (
const ConferenceParticipantDeviceEvent &src
) {
L_D();
if (this != &src) {
ConferenceParticipantEvent::operator=(src);
d->gruuAddress = src.getPrivate()->gruuAddress;
}
return *this;
}
const Address &ConferenceParticipantDeviceEvent::getGruuAddress () const {
L_D();
return d->gruuAddress;
......
......@@ -38,14 +38,12 @@ public:
const Address &participantAddress,
const Address &gruuAddress
);
ConferenceParticipantDeviceEvent (const ConferenceParticipantDeviceEvent &src);
ConferenceParticipantDeviceEvent &operator= (const ConferenceParticipantDeviceEvent &src);
const Address &getGruuAddress () const;
private:
L_DECLARE_PRIVATE(ConferenceParticipantDeviceEvent);
L_DISABLE_COPY(ConferenceParticipantDeviceEvent);
};
LINPHONE_END_NAMESPACE
......
......@@ -44,16 +44,6 @@ ConferenceParticipantEvent::ConferenceParticipantEvent (
d->participantAddress = participantAddress;
}
ConferenceParticipantEvent::ConferenceParticipantEvent (
const ConferenceParticipantEvent &src
) : ConferenceParticipantEvent(
src.getType(),
src.getTime(),
src.getConferenceAddress(),
src.getNotifyId(),
src.getParticipantAddress()
) {}
ConferenceParticipantEvent::ConferenceParticipantEvent (
ConferenceParticipantEventPrivate &p,
Type type,
......@@ -66,16 +56,6 @@ ConferenceParticipantEvent::ConferenceParticipantEvent (
d->participantAddress = participantAddress;
}
ConferenceParticipantEvent &ConferenceParticipantEvent::operator= (const ConferenceParticipantEvent &src) {
L_D();
if (this != &src) {
ConferenceEvent::operator=(src);
d->participantAddress = src.getPrivate()->participantAddress;
}
return *this;
}
const Address &ConferenceParticipantEvent::getParticipantAddress () const {
L_D();
return d->participantAddress;
......
......@@ -37,9 +37,6 @@ public:
unsigned int notifyId,
const Address &participantAddress
);
ConferenceParticipantEvent (const ConferenceParticipantEvent &src);
ConferenceParticipantEvent &operator= (const ConferenceParticipantEvent &src);
const Address &getParticipantAddress () const;
......@@ -55,6 +52,7 @@ protected:
private:
L_DECLARE_PRIVATE(ConferenceParticipantEvent);
L_DISABLE_COPY(ConferenceParticipantEvent);
};
LINPHONE_END_NAMESPACE
......
......@@ -49,19 +49,6 @@ ConferenceSubjectEvent::ConferenceSubjectEvent (
d->subject = subject;
}
ConferenceSubjectEvent::ConferenceSubjectEvent (const ConferenceSubjectEvent &src) :
ConferenceSubjectEvent(src.getTime(), src.getConferenceAddress(), src.getNotifyId(), src.getSubject()) {}
ConferenceSubjectEvent &ConferenceSubjectEvent::operator= (const ConferenceSubjectEvent &src) {
L_D();
if (this != &src) {
ConferenceEvent::operator=(src);
d->subject = src.getPrivate()->subject;
}
return *this;
}
const string &ConferenceSubjectEvent::getSubject () const {
L_D();
return d->subject;
......
......@@ -20,6 +20,8 @@
#ifndef _CONFERENCE_SUBJECT_EVENT_H_
#define _CONFERENCE_SUBJECT_EVENT_H_
#include <string>
#include "conference-notified-event.h"
// =============================================================================
......@@ -36,14 +38,12 @@ public:
unsigned int notifyId,
const std::string &subject
);
ConferenceSubjectEvent (const ConferenceSubjectEvent &src);
ConferenceSubjectEvent &operator= (const ConferenceSubjectEvent &src);
const std::string &getSubject () const;
private:
L_DECLARE_PRIVATE(ConferenceSubjectEvent);
L_DISABLE_COPY(ConferenceSubjectEvent);
};
LINPHONE_END_NAMESPACE
......
......@@ -20,14 +20,15 @@
#ifndef _EVENT_LOG_P_H_
#define _EVENT_LOG_P_H_
#include "object/base-object-p.h"
#include "event-log.h"
#include "object/clonable-object-p.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class EventLogPrivate : public ClonableObjectPrivate {
class EventLogPrivate : public BaseObjectPrivate {
public:
long storageId = -1;
......
......@@ -23,23 +23,14 @@
LINPHONE_BEGIN_NAMESPACE
EventLog::EventLog () : ClonableObject(*new EventLogPrivate) {}
EventLog::EventLog () : BaseObject(*new EventLogPrivate) {}
EventLog::EventLog (const EventLog &) : ClonableObject(*new EventLogPrivate) {}
EventLog::EventLog (EventLogPrivate &p, Type type, time_t time) : ClonableObject(*new EventLogPrivate) {
EventLog::EventLog (EventLogPrivate &p, Type type, std::time_t time) : BaseObject(p) {
L_D();
d->type = type;
d->time = time;
}
EventLog &EventLog::operator= (const EventLog &src) {
L_D();
if (this != &src)
d->type = src.getPrivate()->type;
return *this;
}
EventLog::Type EventLog::getType () const {
L_D();
return d->type;
......
......@@ -25,7 +25,7 @@
#include "linphone/enums/event-log-enums.h"
#include "linphone/utils/enum-generator.h"
#include "object/clonable-object.h"
#include "object/base-object.h"
// =============================================================================
......@@ -33,16 +33,13 @@ LINPHONE_BEGIN_NAMESPACE
class EventLogPrivate;
class LINPHONE_PUBLIC EventLog : public ClonableObject {
class LINPHONE_PUBLIC EventLog : public BaseObject {
friend class MainDb;
public:
L_DECLARE_ENUM(Type, L_ENUM_VALUES_EVENT_LOG_TYPE);
EventLog ();
EventLog (const EventLog &src);
EventLog &operator= (const EventLog &src);
Type getType () const;
std::time_t getTime () const;
......@@ -52,6 +49,7 @@ protected:
private:
L_DECLARE_PRIVATE(EventLog);
L_DISABLE_COPY(EventLog);
};
LINPHONE_END_NAMESPACE
......
/*
* base-object-p.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _BASE_OBJECT_P_H_
#define _BASE_OBJECT_P_H_
#include "linphone/utils/general.h"
#include "object-head-p.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class BaseObjectPrivate {
L_OBJECT_PRIVATE;
public:
BaseObjectPrivate () = default;
virtual ~BaseObjectPrivate () = default;
protected:
BaseObject *mPublic = nullptr;
private:
L_DECLARE_PUBLIC(BaseObject);
};
LINPHONE_END_NAMESPACE
#endif // ifndef _BASE_OBJECT_P_H_
/*
* base-object.cpp
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "base-object-p.h"
#include "base-object.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
L_OBJECT_IMPL(BaseObject);
BaseObject::BaseObject (BaseObjectPrivate &p) : mPrivate(&p) {
mPrivate->mPublic = this;
}
BaseObject::~BaseObject () {
delete mPrivate;
}
LINPHONE_END_NAMESPACE
/*
* base-object.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _BASE_OBJECT_H_
#define _BASE_OBJECT_H_
#include "linphone/utils/general.h"
#include "object-head.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class BaseObjectPrivate;