[ekiga/ds-fix-boost-leaks] Account: Migrated to DynamicObject/DynamicObjectStore.



commit 3926144e1f7da554ddfd38dae55b79a87e85bb77
Author: Damien Sandras <dsandras seconix com>
Date:   Sun May 31 14:53:45 2015 +0200

    Account: Migrated to DynamicObject/DynamicObjectStore.
    
    We also make sure to "use" a DynamicObjectStore instead of purely
    inheriting from that object.

 lib/engine/account/account.h   |    5 ++---
 lib/engine/account/bank-impl.h |   28 +++++++++++++---------------
 lib/engine/account/bank.h      |    4 +---
 3 files changed, 16 insertions(+), 21 deletions(-)
---
diff --git a/lib/engine/account/account.h b/lib/engine/account/account.h
index 95d6b9c..59bff3f 100644
--- a/lib/engine/account/account.h
+++ b/lib/engine/account/account.h
@@ -41,7 +41,7 @@
 #include <string>
 
 #include <boost/smart_ptr.hpp>
-#include "live-object.h"
+#include "actor.h"
 
 namespace Ekiga
 {
@@ -51,8 +51,7 @@ namespace Ekiga
    * @{
    */
 
-  class Account:
-    public virtual LiveObject
+  class Account: public virtual Actor
   {
   public:
 
diff --git a/lib/engine/account/bank-impl.h b/lib/engine/account/bank-impl.h
index ebfd8ee..db09bf9 100644
--- a/lib/engine/account/bank-impl.h
+++ b/lib/engine/account/bank-impl.h
@@ -36,7 +36,7 @@
 #ifndef __BANK_IMPL_H__
 #define __BANK_IMPL_H__
 
-#include "reflister.h"
+#include "dynamic-object-store.h"
 #include "bank.h"
 
 
@@ -68,15 +68,13 @@ namespace Ekiga
    *    backend.
    */
   template<class AccountType = Account>
-  class BankImpl:
-    public Bank,
-    protected RefLister<AccountType>
+  class BankImpl: public Bank
   {
 
   public:
 
-    typedef typename RefLister<AccountType>::iterator iterator;
-    typedef typename RefLister<AccountType>::const_iterator const_iterator;
+    typedef typename DynamicObjectStore<AccountType>::iterator iterator;
+    typedef typename DynamicObjectStore<AccountType>::const_iterator const_iterator;
 
     /** The constructor
      */
@@ -126,7 +124,7 @@ namespace Ekiga
      */
     void remove_account (boost::shared_ptr<AccountType> account);
 
-    using RefLister<AccountType>::add_connection;
+    DynamicObjectStore<AccountType> accounts;
   };
 
 /**
@@ -142,9 +140,9 @@ template<typename AccountType>
 Ekiga::BankImpl<AccountType>::BankImpl ()
 {
   /* this is signal forwarding */
-  RefLister<AccountType>::object_added.connect (boost::ref (account_added));
-  RefLister<AccountType>::object_removed.connect (boost::ref (account_removed));
-  RefLister<AccountType>::object_updated.connect (boost::ref (account_updated));
+  accounts.object_added.connect (boost::ref (account_added));
+  accounts.object_removed.connect (boost::ref (account_removed));
+  accounts.object_updated.connect (boost::ref (account_updated));
 }
 
 
@@ -158,7 +156,7 @@ template<typename AccountType>
 void
 Ekiga::BankImpl<AccountType>::visit_accounts (boost::function1<bool, AccountPtr> visitor) const
 {
-  RefLister<AccountType>::visit_objects (visitor);
+  accounts.visit_objects (visitor);
 }
 
 
@@ -166,7 +164,7 @@ template<typename AccountType>
 typename Ekiga::BankImpl<AccountType>::iterator
 Ekiga::BankImpl<AccountType>::begin ()
 {
-  return RefLister<AccountType>::begin ();
+  return accounts.begin ();
 }
 
 
@@ -174,7 +172,7 @@ template<typename AccountType>
 typename Ekiga::BankImpl<AccountType>::iterator
 Ekiga::BankImpl<AccountType>::end ()
 {
-  return RefLister<AccountType>::end ();
+  return accounts.end ();
 }
 
 
@@ -182,7 +180,7 @@ template<typename AccountType>
 typename Ekiga::BankImpl<AccountType>::const_iterator
 Ekiga::BankImpl<AccountType>::begin () const
 {
-  return RefLister<AccountType>::begin ();
+  return accounts.begin ();
 }
 
 
@@ -190,7 +188,7 @@ template<typename AccountType>
 typename Ekiga::BankImpl<AccountType>::const_iterator
 Ekiga::BankImpl<AccountType>::end () const
 {
-  return RefLister<AccountType>::end ();
+  return accounts.end ();
 }
 
 
diff --git a/lib/engine/account/bank.h b/lib/engine/account/bank.h
index b658447..ee8260d 100644
--- a/lib/engine/account/bank.h
+++ b/lib/engine/account/bank.h
@@ -48,9 +48,7 @@ namespace Ekiga
    * @{
    */
 
-  class Bank:
-    public Actor,
-    public virtual LiveObject
+  class Bank: public virtual Actor
   {
   public:
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]