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