Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill unused DynarRange; move newDeleteDynar() in dynar.h.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 12 Apr 2018 20:00:22 +0000 (22:00 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 13 Apr 2018 10:36:20 +0000 (12:36 +0200)
include/xbt/dynar.h
include/xbt/dynar.hpp [deleted file]
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/checker/LivenessChecker.cpp
src/mc/mc_comm_pattern.cpp
tools/cmake/DefinePackages.cmake

index 52a99e0..095187f 100644 (file)
@@ -260,4 +260,16 @@ xbt_dynar_foreach (dyn,cpt,str) {
 /** @} */
 SG_END_DECL()
 
+#ifdef __cplusplus
+namespace simgrid {
+namespace xbt {
+/** Dynar of `T*` which `delete` its values */
+template <class T> inline xbt_dynar_t newDeleteDynar()
+{
+  return xbt_dynar_new(sizeof(T*), [](void* p) { delete *(T**)p; });
+}
+}
+}
+#endif
+
 #endif /* XBT_DYNAR_H */
diff --git a/include/xbt/dynar.hpp b/include/xbt/dynar.hpp
deleted file mode 100644 (file)
index 84fe5a2..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (c) 2004-2018. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SIMGRID_XBT_DYNAR_HPP
-#define SIMGRID_XBT_DYNAR_HPP
-
-#include <boost/range/iterator_range.hpp>
-#include <xbt/asserts.h>
-#include <xbt/dynar.h>
-
-namespace simgrid {
-namespace xbt {
-
-/** A C++ range from a a dynar */
-template<class T>
-using DynarRange = boost::iterator_range<T*>;
-
-/** Create an iterator range representing a dynar
- *
- *  C++ range loops for `xbt_dynar_t`:
- *
- *  <code>for (auto& x : range<double>(some_dynar)) ++x;</code>
- */
-template<class T> inline
-DynarRange<T> range(xbt_dynar_t dynar)
-{
-  xbt_assert(dynar->elmsize == sizeof(T));
-  return DynarRange<T>((T*) dynar->data,
-    (T*) ((char*) dynar->data + dynar->used * dynar->elmsize));
-}
-
-/** Dynar of `T*` which `delete` its values */
-template<class T> inline
-xbt_dynar_t newDeleteDynar()
-{
-  return xbt_dynar_new(sizeof(T*),
-    [](void* p) { delete *(T**)p; });
-}
-
-}
-}
-#endif
index db4a3d3..68836c6 100644 (file)
@@ -6,7 +6,6 @@
 #include <cstdint>
 
 #include <xbt/dynar.h>
-#include <xbt/dynar.hpp>
 #include <xbt/log.h>
 #include <xbt/sysdep.h>
 
index 23f8513..8d87f5b 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <xbt/automaton.h>
 #include <xbt/dynar.h>
-#include <xbt/dynar.hpp>
 #include <xbt/log.h>
 #include <xbt/sysdep.h>
 
index 32f6e57..3bcefee 100644 (file)
@@ -7,7 +7,6 @@
 
 #include "xbt/dynar.h"
 #include "xbt/sysdep.h"
-#include <xbt/dynar.hpp>
 
 #include "src/mc/checker/CommunicationDeterminismChecker.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
index aea9490..2650faf 100644 (file)
@@ -732,7 +732,6 @@ set(headers_to_install
   include/xbt/cunit.h
   include/xbt/dict.h
   include/xbt/dynar.h
-  include/xbt/dynar.hpp
   include/xbt/ex.h
   include/xbt/ex.hpp
   include/xbt/exception.hpp