mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-31 02:09:22 +00:00
feat(object): ObjectPrivate is now in object-p.h
This commit is contained in:
parent
bdd7869387
commit
f5c98467ba
7 changed files with 82 additions and 18 deletions
|
|
@ -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"
|
||||
|
|
|
|||
41
src/object/object-p.h
Normal file
41
src/object/object-p.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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_
|
||||
33
src/object/object.cpp
Normal file
33
src/object/object.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue