Commit f5c98467 authored by Ronan's avatar Ronan

feat(object): ObjectPrivate is now in object-p.h

parent bdd78693
......@@ -30,6 +30,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
cpim/parser/cpim-grammar.h
cpim/parser/cpim-parser.h
object/object.h
object/object-p.h
object/singleton.h
utils/general.h
utils/utils.h
......@@ -42,6 +43,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
cpim/message/cpim-message.cpp
cpim/parser/cpim-grammar.cpp
cpim/parser/cpim-parser.cpp
object/object.cpp
utils/utils.cpp
)
......
......@@ -20,6 +20,7 @@
#define _CPIM_HEADER_P_H_
#include "cpim-header.h"
#include "object/object-p.h"
// =============================================================================
......
......@@ -19,6 +19,7 @@
#include <algorithm>
#include "cpim/parser/cpim-parser.h"
#include "object/object-p.h"
#include "utils/utils.h"
#include "cpim-message.h"
......
......@@ -24,6 +24,7 @@
#include "linphone/core.h"
#include "cpim-grammar.h"
#include "object/object-p.h"
#include "utils/utils.h"
#include "cpim-parser.h"
......
/*
* object-p.h
* Copyright (C) 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _OBJECT_P_H_
#define _OBJECT_P_H_
#include "utils/general.h"
// =============================================================================
namespace LinphonePrivate {
class Object;
class ObjectPrivate {
public:
virtual ~ObjectPrivate () = default;
protected:
Object *mPublic = nullptr;
private:
L_DECLARE_PUBLIC(Object);
};
}
#endif // ifndef _OBJECT_P_H_
/*
* object.cpp
* Copyright (C) 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include "object-p.h"
#include "object.h"
using namespace LinphonePrivate;
// =============================================================================
Object::~Object () {
delete mPrivate;
}
Object::Object (ObjectPrivate &p) : mPrivate(&p) {
mPrivate->mPublic = this;
}
......@@ -24,29 +24,14 @@
// =============================================================================
namespace LinphonePrivate {
class Object;
class ObjectPrivate {
public:
virtual ~ObjectPrivate () = default;
protected:
Object *mPublic = nullptr;
private:
L_DECLARE_PUBLIC(Object);
};
class ObjectPrivate;
class LINPHONE_PUBLIC Object {
public:
virtual ~Object () {
delete mPrivate;
}
virtual ~Object ();
protected:
explicit Object (ObjectPrivate &p) : mPrivate(&p) {
mPrivate->mPublic = this;
}
explicit Object (ObjectPrivate &p);
ObjectPrivate *mPrivate = nullptr;
......
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