Commit ad7cb274 authored by Ronan's avatar Ronan

fix(chat/conference): use const shared_ptr reference in removeParticipant(s)

parent 5a5e12df
......@@ -144,7 +144,7 @@ public:
}
template<typename CType, typename CppType>
static inline CType * getCBackPtr (const std::shared_ptr<CppType> &object, CType *(*cTypeAllocator)()) {
static inline CType *getCBackPtr (const std::shared_ptr<CppType> &object, CType *(*cTypeAllocator)()) {
Variant v = object->getProperty("LinphonePrivate::Wrapper::cBackPtr");
void *value = v.getValue<void *>();
if (!value) {
......@@ -155,7 +155,7 @@ public:
}
template<typename CType, typename CppType>
static inline CType * getCBackPtr (const CppType *object, CType *(*cTypeAllocator)()) {
static inline CType *getCBackPtr (const CppType *object, CType *(*cTypeAllocator)()) {
Variant v = object->getProperty("LinphonePrivate::Wrapper::cBackPtr");
void *value = v.getValue<void *>();
if (!value) {
......@@ -168,19 +168,19 @@ public:
// ---------------------------------------------------------------------------
template<typename T>
static void * getUserData (const std::shared_ptr<T> &cppPtr) {
static void *getUserData (const std::shared_ptr<T> &cppPtr) {
Variant v = cppPtr->getProperty("LinphonePrivate::Wrapper::userData");
return v.getValue<void *>();
}
template<typename T>
static void * getUserData (T *cppPtr) {
static void *getUserData (T *cppPtr) {
Variant v = cppPtr->getProperty("LinphonePrivate::Wrapper::userData");
return v.getValue<void *>();
}
template<typename T>
static inline void setUserData (std::shared_ptr<T> object, void *value) {
static inline void setUserData (const std::shared_ptr<T> &object, void *value) {
L_ASSERT(object);
object->setProperty("LinphonePrivate::Wrapper::userData", value);
}
......@@ -194,7 +194,7 @@ public:
// ---------------------------------------------------------------------------
template<typename T>
static inline bctbx_list_t * getCListFromCppList (const std::list<T> cppList) {
static inline bctbx_list_t *getCListFromCppList (const std::list<T> cppList) {
bctbx_list_t *result = nullptr;
for (const auto &value : cppList)
result = bctbx_list_append(result, value);
......@@ -202,7 +202,7 @@ public:
}
template<typename CppType, typename CType>
static inline bctbx_list_t * getCListOfStructPtrFromCppListOfCppObj (const std::list<std::shared_ptr<CppType>> cppList, CType *(*cTypeAllocator)()) {
static inline bctbx_list_t *getCListOfStructPtrFromCppListOfCppObj (const std::list<std::shared_ptr<CppType>> cppList, CType *(*cTypeAllocator)()) {
bctbx_list_t *result = nullptr;
for (const auto &value : cppList)
result = bctbx_list_append(result, getCBackPtr(value, cTypeAllocator));
......@@ -210,7 +210,7 @@ public:
}
template<typename CppType, typename CType>
static inline bctbx_list_t * getCListOfStructPtrFromCppListOfCppObj (const std::list<CppType> cppList, CType *(*cTypeAllocator)()) {
static inline bctbx_list_t *getCListOfStructPtrFromCppListOfCppObj (const std::list<CppType> cppList, CType *(*cTypeAllocator)()) {
bctbx_list_t *result = nullptr;
for (const auto &value : cppList)
result = bctbx_list_append(result, getCBackPtr(value, cTypeAllocator));
......
......@@ -65,11 +65,11 @@ list<shared_ptr<Participant>> BasicChatRoom::getParticipants () const {
return l;
}
void BasicChatRoom::removeParticipant (const shared_ptr<Participant> participant) {
void BasicChatRoom::removeParticipant (const shared_ptr<const Participant> &participant) {
lError() << "removeParticipant() is not allowed on a BasicChatRoom";
}
void BasicChatRoom::removeParticipants (const list<shared_ptr<Participant>> participants) {
void BasicChatRoom::removeParticipants (const list<shared_ptr<Participant>> &participants) {
lError() << "removeParticipants() is not allowed on a BasicChatRoom";
}
......
......@@ -45,8 +45,8 @@ public:
const std::string& getId () const;
int getNbParticipants () const;
std::list<std::shared_ptr<Participant>> getParticipants () const;
void removeParticipant (const std::shared_ptr<Participant> participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> participants);
void removeParticipant (const std::shared_ptr<const Participant> &participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
private:
L_DECLARE_PRIVATE(BasicChatRoom);
......@@ -56,4 +56,3 @@ private:
LINPHONE_END_NAMESPACE
#endif // ifndef _BASIC_CHAT_ROOM_H_
......@@ -71,11 +71,11 @@ list<shared_ptr<Participant>> ClientGroupChatRoom::getParticipants () const {
return participants;
}
void ClientGroupChatRoom::removeParticipant (const shared_ptr<Participant> participant) {
void ClientGroupChatRoom::removeParticipant (const shared_ptr<const Participant> &participant) {
// TODO
}
void ClientGroupChatRoom::removeParticipants (const list<shared_ptr<Participant>> participants) {
void ClientGroupChatRoom::removeParticipants (const list<shared_ptr<Participant>> &participants) {
// TODO
}
......
......@@ -46,8 +46,8 @@ public:
const std::string& getId () const;
int getNbParticipants () const;
std::list<std::shared_ptr<Participant>> getParticipants () const;
void removeParticipant (const std::shared_ptr<Participant> participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> participants);
void removeParticipant (const std::shared_ptr<const Participant> &participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
private:
L_DECLARE_PRIVATE(ClientGroupChatRoom);
......@@ -57,4 +57,3 @@ private:
LINPHONE_END_NAMESPACE
#endif // ifndef _CLIENT_GROUP_CHAT_ROOM_H_
......@@ -173,11 +173,11 @@ list<shared_ptr<Participant>> RealTimeTextChatRoom::getParticipants () const {
return l;
}
void RealTimeTextChatRoom::removeParticipant (const shared_ptr<Participant> participant) {
void RealTimeTextChatRoom::removeParticipant (const shared_ptr<const Participant> &participant) {
lError() << "removeParticipant() is not allowed on a RealTimeTextChatRoom";
}
void RealTimeTextChatRoom::removeParticipants (const list<shared_ptr<Participant>> participants) {
void RealTimeTextChatRoom::removeParticipants (const list<shared_ptr<Participant>> &participants) {
lError() << "removeParticipants() is not allowed on a RealTimeTextChatRoom";
}
......
......@@ -49,8 +49,8 @@ public:
const std::string& getId () const;
int getNbParticipants () const;
std::list<std::shared_ptr<Participant>> getParticipants () const;
void removeParticipant (const std::shared_ptr<Participant> participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> participants);
void removeParticipant (const std::shared_ptr<const Participant> &participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
private:
L_DECLARE_PRIVATE(RealTimeTextChatRoom);
......@@ -60,4 +60,3 @@ private:
LINPHONE_END_NAMESPACE
#endif // ifndef _REAL_TIME_TEXT_CHAT_ROOM_H_
......@@ -40,8 +40,8 @@ public:
virtual const std::string& getId () const = 0;
virtual int getNbParticipants () const = 0;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const = 0;
virtual void removeParticipant (const std::shared_ptr<Participant> participant) = 0;
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> participants) = 0;
virtual void removeParticipant (const std::shared_ptr<const Participant> &participant) = 0;
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants) = 0;
};
LINPHONE_END_NAMESPACE
......
......@@ -66,11 +66,11 @@ list<shared_ptr<Participant>> Conference::getParticipants () const {
return participants;
}
void Conference::removeParticipant (const shared_ptr<Participant> participant) {
void Conference::removeParticipant (const shared_ptr<const Participant> &participant) {
// TODO
}
void Conference::removeParticipants (const list<shared_ptr<Participant>> participants) {
void Conference::removeParticipants (const list<shared_ptr<Participant>> &participants) {
// TODO
}
......
......@@ -56,8 +56,8 @@ public:
virtual const std::string& getId () const;
virtual int getNbParticipants () const;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const;
virtual void removeParticipant (const std::shared_ptr<Participant> participant);
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> participants);
virtual void removeParticipant (const std::shared_ptr<const Participant> &participant);
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
private:
/* CallSessionListener */
......
......@@ -68,7 +68,7 @@ list<shared_ptr<Participant>> LocalConference::getParticipants () const {
return participants;
}
void LocalConference::removeParticipant (const shared_ptr<Participant> participant) {
void LocalConference::removeParticipant (const shared_ptr<const Participant> &participant) {
for (const auto &p : participants) {
if (participant->getAddress().equal(p->getAddress())) {
participants.remove(p);
......@@ -77,7 +77,7 @@ void LocalConference::removeParticipant (const shared_ptr<Participant> participa
}
}
void LocalConference::removeParticipants (const list<shared_ptr<Participant>> participants) {
void LocalConference::removeParticipants (const list<shared_ptr<Participant>> &participants) {
for (const auto &p : participants)
removeParticipant(p);
}
......@@ -41,8 +41,8 @@ public:
virtual const std::string& getId () const;
virtual int getNbParticipants () const;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const;
virtual void removeParticipant (const std::shared_ptr<Participant> participant);
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> participants);
virtual void removeParticipant (const std::shared_ptr<const Participant> &participant);
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
private:
L_DISABLE_COPY(LocalConference);
......
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