Quellcode durchsuchen

Move RootCoordinator to common namespace

Eric Ramat vor 11 Jahren
Ursprung
Commit
fcbae966d6

+ 2 - 2
src/common/CMakeLists.txt

@@ -10,10 +10,10 @@ LINK_DIRECTORIES(
   ${LIBXML_LIBRARY_DIR})
 
 SET(COMMON_CPP Bag.cpp Builder.cpp EventTable.cpp ExternalEvent.cpp
-  InternalEvent.cpp Links.cpp Model.cpp Node.cpp Trace.cpp)
+  InternalEvent.cpp Links.cpp Model.cpp Node.cpp RootCoordinator.cpp Trace.cpp)
 
 SET(COMMON_HPP Bag.hpp Builder.hpp EventTable.hpp ExternalEvent.hpp
-  InternalEvent.hpp Links.hpp Node.hpp Time.hpp Trace.cpp)
+  InternalEvent.hpp Links.hpp Node.hpp RootCoordinator.hpp Time.hpp Trace.cpp)
 
 ADD_LIBRARY(common SHARED ${COMMON_CPP};${COMMON_HPP})
 

+ 3 - 3
src/pdevs/RootCoordinator.cpp

@@ -24,9 +24,9 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <pdevs/RootCoordinator.hpp>
+#include <common/RootCoordinator.hpp>
 
-namespace paradevs { namespace pdevs {
+namespace paradevs { namespace common {
 
 RootCoordinator::RootCoordinator(const common::Time& t_start,
                                  const common::Time& t_max,
@@ -47,4 +47,4 @@ void RootCoordinator::run()
     }
 }
 
-} } // namespace paradevs pdevs
+} } // namespace paradevs common

+ 5 - 5
src/pdevs/RootCoordinator.hpp

@@ -24,13 +24,13 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef PDEVS_ROOT_COORDINATOR
-#define PDEVS_ROOT_COORDINATOR 1
+#ifndef COMMON_ROOT_COORDINATOR
+#define COMMON_ROOT_COORDINATOR 1
 
 #include <common/Builder.hpp>
-#include <pdevs/Coordinator.hpp>
+#include <common/Coordinator.hpp>
 
-namespace paradevs { namespace pdevs {
+namespace paradevs { namespace common {
 
 class RootCoordinator
 {
@@ -48,6 +48,6 @@ private :
     common::Time         _tn;
 };
 
-} } // namespace paradevs pdevs
+} } // namespace paradevs common
 
 #endif

+ 2 - 4
src/pdevs/CMakeLists.txt

@@ -9,11 +9,9 @@ LINK_DIRECTORIES(
   ${GLIBMM_LIBRARY_DIRS}
   ${LIBXML_LIBRARY_DIR})
 
-SET(PDEVS_CPP Coordinator.cpp Dynamics.cpp RootCoordinator.cpp
-  Simulator.cpp)
+SET(PDEVS_CPP Coordinator.cpp Dynamics.cpp Simulator.cpp)
 
-SET(PDEVS_HPP Coordinator.hpp Dynamics.hpp RootCoordinator.hpp
-  Simulator.hpp)
+SET(PDEVS_HPP Coordinator.hpp Dynamics.hpp Simulator.hpp)
 
 ADD_LIBRARY(pdevs SHARED ${PDEVS_CPP};${PDEVS_HPP})
 

+ 1 - 1
src/tests/CMakeLists.txt

@@ -25,7 +25,7 @@ ADD_EXECUTABLE(dtss-tests dtss_tests.hpp dtss_tests.cpp)
 SET_TARGET_PROPERTIES(dtss-tests PROPERTIES ${PARADEVS_APP_PROPERTIES})
 
 TARGET_LINK_LIBRARIES(dtss-tests
-  common dtss pdevs
+  common dtss
   ${GLIBMM_LIBRARIES}
   ${LIBXML_LIBRARIES}
   ${GTHREAD_LIBRARIES}

+ 3 - 3
src/tests/dtss_tests.cpp

@@ -26,10 +26,10 @@
 
 #include <tests/dtss_tests.hpp>
 
+#include <common/RootCoordinator.hpp>
 #include <common/Trace.hpp>
 
 #include <dtss/Coordinator.hpp>
-#include <pdevs/RootCoordinator.hpp>
 
 #define CATCH_CONFIG_MAIN
 #include "catch.hpp"
@@ -124,7 +124,7 @@ common::Model* TwoBuilder::build() const
 TEST_CASE("dtss/only_one", "run")
 {
     paradevs::dtss::OnlyOneBuilder builder;
-    paradevs::pdevs::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator rc(0, 10, builder);
 
     paradevs::common::Trace::trace().clear();
     rc.run();
@@ -145,7 +145,7 @@ TEST_CASE("dtss/only_one", "run")
 TEST_CASE("dtss/two", "run")
 {
     paradevs::dtss::TwoBuilder builder;
-    paradevs::pdevs::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator rc(0, 10, builder);
 
     paradevs::common::Trace::trace().clear();
     rc.run();

+ 4 - 4
src/tests/pdevs_tests.cpp

@@ -26,10 +26,10 @@
 
 #include <tests/pdevs_tests.hpp>
 
+#include <common/RootCoordinator.hpp>
 #include <common/Trace.hpp>
 
 #include <pdevs/Coordinator.hpp>
-#include <pdevs/RootCoordinator.hpp>
 
 #define CATCH_CONFIG_MAIN
 #include "catch.hpp"
@@ -248,7 +248,7 @@ common::Model* FlatBuilder::build() const
 TEST_CASE("pdevs/only_one", "run")
 {
     paradevs::pdevs::OnlyOneBuilder builder;
-    paradevs::pdevs::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator rc(0, 10, builder);
 
     paradevs::common::Trace::trace().clear();
     rc.run();
@@ -278,7 +278,7 @@ TEST_CASE("pdevs/only_one", "run")
 TEST_CASE("pdevs/flat", "run")
 {
     paradevs::pdevs::FlatBuilder builder;
-    paradevs::pdevs::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator rc(0, 10, builder);
 
     paradevs::common::Trace::trace().clear();
     rc.run();
@@ -363,7 +363,7 @@ TEST_CASE("pdevs/flat", "run")
 TEST_CASE("pdevs/hierachical", "run")
 {
     paradevs::pdevs::HierachicalBuilder builder;
-    paradevs::pdevs::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator rc(0, 10, builder);
 
     paradevs::common::Trace::trace().clear();
     rc.run();