getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r4633 - in /trunk/getfem/src: dal_static_stored_objects


From: andriy . andreykiv
Subject: [Getfem-commits] r4633 - in /trunk/getfem/src: dal_static_stored_objects.cc getfem/dal_static_stored_objects.h
Date: Wed, 30 Apr 2014 10:08:24 -0000

Author: andrico
Date: Wed Apr 30 12:08:24 2014
New Revision: 4633

URL: http://svn.gna.org/viewcvs/getfem?rev=4633&view=rev
Log:
a forward declaration for a template

Modified:
    trunk/getfem/src/dal_static_stored_objects.cc
    trunk/getfem/src/getfem/dal_static_stored_objects.h

Modified: trunk/getfem/src/dal_static_stored_objects.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/dal_static_stored_objects.cc?rev=4633&r1=4632&r2=4633&view=diff
==============================================================================
--- trunk/getfem/src/dal_static_stored_objects.cc       (original)
+++ trunk/getfem/src/dal_static_stored_objects.cc       Wed Apr 30 12:08:24 2014
@@ -33,7 +33,7 @@
 
 
 
-  // Pointer to an object with the dependencies
+  /** Pointer to an object with the dependencies */
   struct enr_static_stored_object {
     pstatic_stored_object p;
     atomic_bool valid;
@@ -50,8 +50,8 @@
   };
 
 
- 
-  // Pointer to a key with a coherent order
+
+  /** Pointer to a key with a coherent order */
   struct enr_static_stored_object_key {
     pstatic_stored_object_key p;
     bool operator < (const enr_static_stored_object_key &o) const
@@ -61,11 +61,11 @@
 
 
 
-  // Table of stored objects. Thread safe, uses object specific mutexes.
+  /** Table of stored objects. Thread safe, uses thread specific mutexes. */
   struct stored_object_tab : 
     public std::map<enr_static_stored_object_key, enr_static_stored_object>
   {
-
+  
     struct stored_key_tab : 
       public std::map<pstatic_stored_object,pstatic_stored_object_key> 
     {
@@ -82,6 +82,7 @@
     //adding the object to the storage on the current thread
     void add_stored_object(pstatic_stored_object_key k, pstatic_stored_object 
o,
     permanence perm);
+
     iterator iterator_of_object_(pstatic_stored_object o);
     //delete o2 from the dependency list of o1
     //true if successfull, false if o1 is not 
@@ -108,7 +109,6 @@
     getfem::lock_factory locks_;
     stored_key_tab stored_keys_;
   };
-
 
 
   

Modified: trunk/getfem/src/getfem/dal_static_stored_objects.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/dal_static_stored_objects.h?rev=4633&r1=4632&r2=4633&view=diff
==============================================================================
--- trunk/getfem/src/getfem/dal_static_stored_objects.h (original)
+++ trunk/getfem/src/getfem/dal_static_stored_objects.h Wed Apr 30 12:08:24 2014
@@ -311,20 +311,25 @@
   /** Test the validity of the whole global storage */
   void test_stored_objects(void);
 
+
+
+  struct stored_object_tab;
+
   /** delete all the specific type of stored objects*/
   template<typename OBJECT_TYPE>
   void delete_specific_type_stored_objects(bool all_thread = false)
   {
+    typedef typename stored_object_tab::iterator iterator;
     std::list<pstatic_stored_object> delete_object_list;
 
     if(!all_thread){
       stored_object_tab& stored_objects
         = dal::singleton<stored_object_tab>::instance();
 
-      stored_object_tab::iterator itb = stored_objects.begin();
-      stored_object_tab::iterator ite = stored_objects.end();
-
-      for(stored_object_tab::iterator it = itb; it != ite; ++it){
+      iterator itb = stored_objects.begin();
+      iterator ite = stored_objects.end();
+
+      for(iterator it = itb; it != ite; ++it){
         const OBJECT_TYPE *p_object =  
dal::stored_cast<OBJECT_TYPE>(it->second.p).get();
         if(p_object != 0) delete_object_list.push_back(it->second.p);
       }    
@@ -335,10 +340,10 @@
         stored_object_tab& stored_objects
           = dal::singleton<stored_object_tab>::instance(thread);
 
-        stored_object_tab::iterator itb = stored_objects.begin();
-        stored_object_tab::iterator ite = stored_objects.end();
-
-        for(stored_object_tab::iterator it = itb; it != ite; ++it){
+        iterator itb = stored_objects.begin();
+        iterator ite = stored_objects.end();
+
+        for(iterator it = itb; it != ite; ++it){
           const OBJECT_TYPE *p_object =  
dal::stored_cast<OBJECT_TYPE>(it->second.p).get();
           if(p_object != 0) delete_object_list.push_back(it->second.p);
         }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]