Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change some struct to class.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 7 Oct 2017 12:21:32 +0000 (14:21 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 9 Oct 2017 19:14:47 +0000 (21:14 +0200)
include/simgrid/chrono.hpp
include/simgrid/kernel/future.hpp
src/mc/DwarfExpression.hpp
src/mc/VisitedState.hpp
src/mc/checker/LivenessChecker.hpp
src/mc/mc_state.h
src/xbt/config.cpp

index d3759ca..8f5b480 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2016-2017. 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. */
@@ -37,7 +37,8 @@ namespace simgrid {
  * @endcode
  *
  */
-struct SimulationClock {
+class SimulationClock {
+public:
   using rep        = double;
   using period     = std::ratio<1>;
   using duration   = std::chrono::duration<rep, period>;
index 766d425..a4db6ec 100644 (file)
@@ -207,7 +207,7 @@ public:
 template<class T>
 void bindPromise(Promise<T> promise, Future<T> future)
 {
-  struct PromiseBinder {
+  class PromiseBinder {
   public:
     PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
     void operator()(Future<T> future)
index 1bf89d8..09160c8 100644 (file)
@@ -41,7 +41,8 @@ typedef std::vector<Dwarf_Op> DwarfExpression;
  *  the process memory, etc. All those informations are gathered in
  *  the evaluation context.
  */
-struct ExpressionContext {
+class ExpressionContext {
+public:
   ExpressionContext() :
     cursor(nullptr), frame_base(nullptr), address_space(nullptr),
     object_info(nullptr), process_index(simgrid::mc::ProcessIndexMissing) {}
index 7028f4d..a9a1b82 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2016. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -17,7 +17,8 @@
 namespace simgrid {
 namespace mc {
 
-struct XBT_PRIVATE VisitedState {
+class XBT_PRIVATE VisitedState {
+public:
   std::shared_ptr<simgrid::mc::Snapshot> system_state = nullptr;
   std::size_t heap_bytes_used = 0;
   int actors_count            = 0;
index 16bfff7..ed4994e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -27,7 +27,8 @@ SG_END_DECL()
 namespace simgrid {
 namespace mc {
 
-struct XBT_PRIVATE Pair {
+class XBT_PRIVATE Pair {
+public:
   int num = 0;
   bool search_cycle = false;
   std::shared_ptr<simgrid::mc::State> graph_state = nullptr; /* System state included */
@@ -44,7 +45,8 @@ struct XBT_PRIVATE Pair {
   Pair& operator=(Pair const&) = delete;
 };
 
-struct XBT_PRIVATE VisitedPair {
+class XBT_PRIVATE VisitedPair {
+public:
   int num;
   int other_num = 0; /* Dot output for */
   std::shared_ptr<simgrid::mc::State> graph_state = nullptr; /* System state included */
index d6ee814..7e6a78d 100644 (file)
@@ -22,7 +22,8 @@ enum class PatternCommunicationType {
   receive = 2,
 };
 
-struct PatternCommunication {
+class PatternCommunication {
+public:
   int num = 0;
   simgrid::kernel::activity::CommImpl* comm_addr;
   PatternCommunicationType type = PatternCommunicationType::send;
@@ -104,8 +105,8 @@ public:
 
 /* A node in the exploration graph (kind-of)
  */
-struct XBT_PRIVATE State {
-
+class XBT_PRIVATE State {
+public:
   /** Sequential state number (used for debugging) */
   int num = 0;
 
index 3947248..cb6c810 100644 (file)
@@ -96,30 +96,34 @@ static long int parseLong(const char* value)
 // ***** ConfigType *****
 
 /// A trait which define possible options types:
-template<class T> struct ConfigType;
+template <class T> class ConfigType;
 
-template<> struct ConfigType<int> {
+template <> class ConfigType<int> {
+public:
   static constexpr const char* type_name = "int";
   static inline double parse(const char* value)
   {
     return parseLong(value);
   }
 };
-template<> struct ConfigType<double> {
+template <> class ConfigType<double> {
+public:
   static constexpr const char* type_name = "double";
   static inline double parse(const char* value)
   {
     return parseDouble(value);
   }
 };
-template<> struct ConfigType<std::string> {
+template <> class ConfigType<std::string> {
+public:
   static constexpr const char* type_name = "string";
   static inline std::string parse(const char* value)
   {
     return std::string(value);
   }
 };
-template<> struct ConfigType<bool> {
+template <> class ConfigType<bool> {
+public:
   static constexpr const char* type_name = "boolean";
   static inline bool parse(const char* value)
   {