Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[xbt] Remove useless bits
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 11 Jul 2016 11:56:25 +0000 (13:56 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 11 Jul 2016 11:56:25 +0000 (13:56 +0200)
include/xbt/automaton.h
include/xbt/dict.h
include/xbt/dynar.h
include/xbt/dynar.hpp
include/xbt/fifo.h
include/xbt/heap.h
include/xbt/lib.h
include/xbt/memory.hpp
include/xbt/parmap.h
include/xbt/swag.h

index 90af851..6b8be48 100644 (file)
@@ -115,15 +115,4 @@ XBT_PUBLIC(void) xbt_automaton_free(xbt_automaton_t a);
 
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_automaton_t a)
-  {
-    xbt_automaton_free(a);
-  }
-}
-}
-#endif
-
 #endif
index 6a5e912..87c70ec 100644 (file)
@@ -174,15 +174,4 @@ xbt_dict_foreach(head, cursor, key, data) {
 
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_dict_t d)
-  {
-    xbt_dict_free(&d);
-  }
-}
-}
-#endif
-
 #endif                          /* _XBT_DICT_H */
index 8362120..b8cfbdd 100644 (file)
@@ -258,15 +258,4 @@ xbt_dynar_foreach (dyn,cpt,str) {
 /** @} */
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_dynar_t s)
-  {
-    xbt_dynar_free(&s);
-  }
-}
-}
-#endif
-
 #endif                          /* _XBT_DYNAR_H */
index 2129007..77bb871 100644 (file)
@@ -40,14 +40,6 @@ xbt_dynar_t newDeleteDynar()
     [](void* p) { delete *(T**)p; });
 }
 
-/** Dynar of `T*` which `destroy()` its values */
-template<class T> inline
-xbt_dynar_t newDestroyDynar()
-{
-  return xbt_dynar_new(sizeof(T*),
-    [](void* p) { simgrid::xbt::destroy(*(T**)p); });
-}
-
 }
 }
 #endif
index 61879ca..c373926 100644 (file)
@@ -111,15 +111,4 @@ XBT_PUBLIC(xbt_fifo_item_t) xbt_fifo_getPrevItem(xbt_fifo_item_t i);
 
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_fifo_t f)
-  {
-    xbt_fifo_free(f);
-  }
-}
-}
-#endif
-
 #endif                          /* _XBT_FIFO_H */
index 8ab5753..ddf76dd 100644 (file)
@@ -37,15 +37,4 @@ XBT_PUBLIC(void ) xbt_heap_update(xbt_heap_t H, int i, double key);
 /* @} */
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_heap_t h)
-  {
-    xbt_heap_free(h);
-  }
-}
-}
-#endif
-
 #endif                          /* _XBT_HEAP_H */
index 5e10edd..15553e3 100644 (file)
@@ -77,15 +77,4 @@ XBT_PUBLIC(void) xbt_lib_remove(xbt_lib_t lib, const char *key);
 
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_lib_t l)
-  {
-    xbt_lib_free(&l);
-  }
-}
-}
-#endif
-
 #endif                          /* _XBT_LIB_H */
index ac71407..3673943 100644 (file)
 namespace simgrid {
 namespace xbt {
 
-/** Delete operator which call a `destroy()` free function */
-template<class T>
-struct destroy_delete {
-  void operator()(T* t) const
-  {
-    destroy(t);
-  }
-};
-
-/** A `unique_ptr` which works for SimGrid C types (dynar, swag, automaton, etc.)
- *
- *  It uses an overloaded `destroy()` function to delete the object.
- */
-template<class T>
-using unique_ptr = std::unique_ptr<T, destroy_delete<T> >;
-
 }
 }
 
index e9eb7ca..15257b5 100644 (file)
@@ -48,15 +48,4 @@ XBT_PUBLIC(void*) xbt_parmap_next(xbt_parmap_t parmap);
 
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_parmap_t p)
-  {
-    xbt_parmap_destroy(p);
-  }
-}
-}
-#endif
-
 #endif
index 2431b30..ecbdb15 100644 (file)
@@ -193,15 +193,4 @@ static inline void *xbt_swag_getFirst(xbt_swag_t swag)
 
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_swag_t s)
-  {
-    xbt_swag_free(s);
-  }
-}
-}
-#endif
-
 #endif                          /* _XBT_SWAG_H */