mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Add ClonableObject base class.
This commit is contained in:
parent
21e6a2b679
commit
041797aed1
4 changed files with 126 additions and 0 deletions
|
|
@ -30,6 +30,8 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
|
|||
cpim/parser/cpim-grammar.h
|
||||
cpim/parser/cpim-parser.h
|
||||
logger/logger.h
|
||||
object/clonable-object.h
|
||||
object/clonable-object-p.h
|
||||
object/object-p.h
|
||||
object/object.h
|
||||
object/singleton.h
|
||||
|
|
@ -45,6 +47,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
|
|||
cpim/parser/cpim-grammar.cpp
|
||||
cpim/parser/cpim-parser.cpp
|
||||
logger/logger.cpp
|
||||
object/clonable-object.cpp
|
||||
object/object.cpp
|
||||
utils/utils.cpp
|
||||
)
|
||||
|
|
|
|||
43
src/object/clonable-object-p.h
Normal file
43
src/object/clonable-object-p.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* clonable-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 _CLONABLE_OBJECT_P_H_
|
||||
#define _CLONABLE_OBJECT_P_H_
|
||||
|
||||
#include "utils/general.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class ClonableObject;
|
||||
|
||||
class ClonableObjectPrivate {
|
||||
public:
|
||||
virtual ~ClonableObjectPrivate () = default;
|
||||
|
||||
protected:
|
||||
ClonableObject *mPublic = nullptr;
|
||||
|
||||
private:
|
||||
L_DECLARE_PUBLIC(ClonableObject);
|
||||
};
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
||||
#endif // ifndef _CLONABLE_OBJECT_P_H_
|
||||
35
src/object/clonable-object.cpp
Normal file
35
src/object/clonable-object.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* clonable-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 "clonable-object-p.h"
|
||||
|
||||
#include "clonable-object.h"
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
// =============================================================================
|
||||
|
||||
ClonableObject::~ClonableObject () {
|
||||
delete mPrivate;
|
||||
}
|
||||
|
||||
ClonableObject::ClonableObject (ClonableObjectPrivate &p) : mPrivate(&p) {
|
||||
mPrivate->mPublic = this;
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
45
src/object/clonable-object.h
Normal file
45
src/object/clonable-object.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* clonable-object.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 _CLONABLE_OBJECT_H_
|
||||
#define _CLONABLE_OBJECT_H_
|
||||
|
||||
#include "utils/general.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class ClonableObjectPrivate;
|
||||
|
||||
class LINPHONE_PUBLIC ClonableObject {
|
||||
public:
|
||||
virtual ~ClonableObject ();
|
||||
|
||||
protected:
|
||||
explicit ClonableObject (ClonableObjectPrivate &p);
|
||||
|
||||
ClonableObjectPrivate *mPrivate = nullptr;
|
||||
|
||||
private:
|
||||
L_DECLARE_PRIVATE(ClonableObject);
|
||||
};
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
||||
#endif // ifndef _CLONABLE_OBJECT_H_
|
||||
Loading…
Add table
Reference in a new issue