Commit d70c38f9 authored by Ronan's avatar Ronan

fix(Object): little fixes, remove useless friend and add assert and getSharedFromThis

parent 105e63f2
......@@ -27,6 +27,8 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
class AppDataContainerPrivate {
public:
shared_ptr<unordered_map<string, string>> appData;
......
......@@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _BASE_OBJECT_P_H_
#define _BASE_OBJECT_P_H_
#ifndef _BASE_OBJECT_P_H_
#define _BASE_OBJECT_P_H_
#include "linphone/utils/general.h"
......
......@@ -26,6 +26,8 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
Object::Object (ObjectPrivate &p) : BaseObject(p) {}
shared_ptr<Object> Object::getSharedFromThis () {
......@@ -39,6 +41,8 @@ shared_ptr<const Object> Object::getSharedFromThis () const {
lFatal() << "Object " << this << " was not created with make_shared.";
}
// Unable to reach this point.
L_ASSERT(false);
return nullptr;
}
......
......@@ -38,7 +38,6 @@ class LINPHONE_PUBLIC Object :
public std::enable_shared_from_this<Object>,
public BaseObject,
public PropertyContainer {
friend class ObjectFactory;
public:
std::shared_ptr<Object> getSharedFromThis ();
......
......@@ -27,6 +27,8 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
class PropertyContainerPrivate {
public:
unordered_map<string, Variant> properties;
......
......@@ -31,6 +31,8 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
bool Utils::iequals (const string &a, const string &b) {
size_t size = a.size();
if (b.size() != size)
......
......@@ -27,6 +27,8 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
class VariantPrivate {
public:
union Value {
......
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