Browse Source

Create namespace "logic" for logic module

Patrick-Christopher Mattulat 2 years ago
parent
commit
575e153157
33 changed files with 470 additions and 416 deletions
  1. 2 2
      include/ls_std/event/EventHandler.hpp
  2. 3 3
      include/ls_std/event/EventManager.hpp
  3. 3 3
      include/ls_std/event/IEventSubscriber.hpp
  4. 13 7
      include/ls_std/logic/IListener.hpp
  5. 23 17
      include/ls_std/logic/Narrator.hpp
  6. 32 26
      include/ls_std/logic/State.hpp
  7. 29 23
      include/ls_std/logic/StateConnection.hpp
  8. 37 31
      include/ls_std/logic/StateMachine.hpp
  9. 9 3
      include/ls_std/logic/StateMachineTypes.hpp
  10. 26 20
      include/ls_std/logic/serialization/SerializableJsonState.hpp
  11. 24 18
      include/ls_std/logic/serialization/SerializableJsonStateConnection.hpp
  12. 27 21
      include/ls_std/logic/serialization/SerializableJsonStateMachine.hpp
  13. 2 2
      source/ls_std/event/EventHandler.cpp
  14. 3 3
      source/ls_std/event/EventManager.cpp
  15. 7 7
      source/ls_std/logic/Narrator.cpp
  16. 14 14
      source/ls_std/logic/State.cpp
  17. 10 10
      source/ls_std/logic/StateConnection.cpp
  18. 19 19
      source/ls_std/logic/StateMachine.cpp
  19. 14 14
      source/ls_std/logic/serialization/SerializableJsonState.cpp
  20. 9 9
      source/ls_std/logic/serialization/SerializableJsonStateConnection.cpp
  21. 15 15
      source/ls_std/logic/serialization/SerializableJsonStateMachine.cpp
  22. 7 7
      test/TestDataFactory.cpp
  23. 1 1
      test/TestDataFactory.hpp
  24. 24 24
      test/cases/logic/NarratorTest.cpp
  25. 12 12
      test/cases/logic/StateConnectionTest.cpp
  26. 25 25
      test/cases/logic/StateMachineTest.cpp
  27. 30 30
      test/cases/logic/StateTest.cpp
  28. 14 14
      test/cases/logic/serialization/SerializableJsonStateConnectionTest.cpp
  29. 13 13
      test/cases/logic/serialization/SerializableJsonStateMachineTest.cpp
  30. 17 17
      test/cases/logic/serialization/SerializableJsonStateTest.cpp
  31. 2 2
      test/classes/event/DailyNewsAgency.hpp
  32. 2 2
      test/classes/event/GossipNewsAgency.hpp
  33. 2 2
      test/classes/observer/TestDataMercedesCar.hpp

+ 2 - 2
include/ls_std/event/EventHandler.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -23,7 +23,7 @@ namespace ls
   {
     namespace event
     {
-      class EventHandler : public ls::Narrator
+      class EventHandler : public ls::std::logic::Narrator
       {
         public:
 

+ 3 - 3
include/ls_std/event/EventManager.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -32,8 +32,8 @@ namespace ls
 
           // implementation
 
-          void subscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::IListener> &_listener) override;
-          void unsubscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::IListener> &_listener) override;
+          void subscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::std::logic::IListener> &_listener) override;
+          void unsubscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::std::logic::IListener> &_listener) override;
 
           // additional functionality
 

+ 3 - 3
include/ls_std/event/IEventSubscriber.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2022-05-08
+ * Changed:         2022-05-11
  *
  * */
 
@@ -27,8 +27,8 @@ namespace ls
           IEventSubscriber() = default;
           ~IEventSubscriber() = default;
 
-          virtual void subscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::IListener> &_listener) = 0;
-          virtual void unsubscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::IListener> &_listener) = 0;
+          virtual void subscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::std::logic::IListener> &_listener) = 0;
+          virtual void unsubscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::std::logic::IListener> &_listener) = 0;
       };
     }
   }

+ 13 - 7
include/ls_std/logic/IListener.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -14,15 +14,21 @@
 
 namespace ls
 {
-  class IListener
+  namespace std
   {
-    public:
+    namespace logic
+    {
+      class IListener
+      {
+        public:
 
-      IListener() = default;
-      ~IListener() = default;
+          IListener() = default;
+          ~IListener() = default;
 
-      virtual void listen(const ls::std::core::Class &_info) = 0;
-  };
+          virtual void listen(const ls::std::core::Class &_info) = 0;
+      };
+    }
+  }
 }
 
 #endif

+ 23 - 17
include/ls_std/logic/Narrator.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -17,23 +17,29 @@
 
 namespace ls
 {
-  class Narrator : public ls::std::core::Class
+  namespace std
   {
-    public:
-
-      Narrator();
-      ~Narrator() override = default;
-
-      bool addListener(const ::std::shared_ptr<ls::IListener> &_listener);
-      void clear();
-      ::std::list<::std::shared_ptr<ls::IListener>> getListeners();
-      bool removeListener(const ::std::shared_ptr<ls::IListener> &_listener);
-      void tell(const ls::std::core::Class &_info);
-
-    private:
-
-      ::std::list<::std::shared_ptr<ls::IListener>> listeners{};
-  };
+    namespace logic
+    {
+      class Narrator : public ls::std::core::Class
+      {
+        public:
+
+          Narrator();
+          ~Narrator() override = default;
+
+          bool addListener(const ::std::shared_ptr<ls::std::logic::IListener> &_listener);
+          void clear();
+          ::std::list<::std::shared_ptr<ls::std::logic::IListener>> getListeners();
+          bool removeListener(const ::std::shared_ptr<ls::std::logic::IListener> &_listener);
+          void tell(const ls::std::core::Class &_info);
+
+        private:
+
+          ::std::list<::std::shared_ptr<ls::std::logic::IListener>> listeners{};
+      };
+    }
+  }
 }
 
 #endif

+ 32 - 26
include/ls_std/logic/State.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -19,32 +19,38 @@
 
 namespace ls
 {
-  class State : public ls::std::core::Class
+  namespace std
   {
-    public:
-
-      explicit State(const ls::StateId& _id);
-      ~State() override = default;
-
-      // additional functionality
-
-      bool addStateConnection(const ls::StateConnectionId &_connectionId, const ::std::shared_ptr<ls::State> &_connectedState);
-      bool addStateConnection(const ::std::shared_ptr<ls::StateConnection> &_connection);
-      void clearConnections();
-      ::std::unordered_map<ls::StateConnectionId, ::std::shared_ptr<ls::StateConnection>> getConnectedStates();
-      ls::StateId getId();
-      bool hasConnection(const ls::StateConnectionId &_connectionId);
-      void setId(const ls::StateId& _id);
-
-    private:
-
-      ::std::unordered_map<ls::StateConnectionId, ::std::shared_ptr<ls::StateConnection>> connectedStates{};
-      ls::StateId id{};
-
-      void _assignStateId(const ls::StateId& _id);
-      void _clearConnections();
-      bool _hasConnection(const ls::StateConnectionId &_connectionId);
-  };
+    namespace logic
+    {
+      class State : public ls::std::core::Class
+      {
+        public:
+
+          explicit State(const ls::std::logic::StateId &_id);
+          ~State() override = default;
+
+          // additional functionality
+
+          bool addStateConnection(const ls::std::logic::StateConnectionId &_connectionId, const ::std::shared_ptr<ls::std::logic::State> &_connectedState);
+          bool addStateConnection(const ::std::shared_ptr<ls::std::logic::StateConnection> &_connection);
+          void clearConnections();
+          ::std::unordered_map<ls::std::logic::StateConnectionId, ::std::shared_ptr<ls::std::logic::StateConnection>> getConnectedStates();
+          ls::std::logic::StateId getId();
+          bool hasConnection(const ls::std::logic::StateConnectionId &_connectionId);
+          void setId(const ls::std::logic::StateId &_id);
+
+        private:
+
+          ::std::unordered_map<ls::std::logic::StateConnectionId, ::std::shared_ptr<ls::std::logic::StateConnection>> connectedStates{};
+          ls::std::logic::StateId id{};
+
+          void _assignStateId(const ls::std::logic::StateId &_id);
+          void _clearConnections();
+          bool _hasConnection(const ls::std::logic::StateConnectionId &_connectionId);
+      };
+    }
+  }
 }
 
 #endif

+ 29 - 23
include/ls_std/logic/StateConnection.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-10
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -16,29 +16,35 @@
 
 namespace ls
 {
-  class StateConnection : public ls::std::core::Class
+  namespace std
   {
-    public:
-
-      explicit StateConnection(const ls::StateConnectionId& _connectionId, const ls::StateId& _stateId);
-      ~StateConnection() override = default;
-
-      StateConnectionId getConnectionId();
-      ls::StateId getStateId();
-      bool isPassable() const;
-      void setConnectionId(const ls::StateConnectionId& _connectionId);
-      void setStateId(const ls::StateId& _stateId);
-      void updatePassCondition(bool _condition);
-
-    private:
-
-      bool condition{};
-      ls::StateConnectionId connectionId{};
-      ls::StateId stateId{};
-
-      void _assignConnectionId(const ls::StateConnectionId& _connectionId);
-      void _assignStateId(const ls::StateId& _stateId);
-  };
+    namespace logic
+    {
+      class StateConnection : public ls::std::core::Class
+      {
+        public:
+
+          explicit StateConnection(const ls::std::logic::StateConnectionId &_connectionId, const ls::std::logic::StateId &_stateId);
+          ~StateConnection() override = default;
+
+          StateConnectionId getConnectionId();
+          ls::std::logic::StateId getStateId();
+          bool isPassable() const;
+          void setConnectionId(const ls::std::logic::StateConnectionId &_connectionId);
+          void setStateId(const ls::std::logic::StateId &_stateId);
+          void updatePassCondition(bool _condition);
+
+        private:
+
+          bool condition{};
+          ls::std::logic::StateConnectionId connectionId{};
+          ls::std::logic::StateId stateId{};
+
+          void _assignConnectionId(const ls::std::logic::StateConnectionId &_connectionId);
+          void _assignStateId(const ls::std::logic::StateId &_stateId);
+      };
+    }
+  }
 }
 
 #endif

+ 37 - 31
include/ls_std/logic/StateMachine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -20,37 +20,43 @@
 
 namespace ls
 {
-  class StateMachine : public ls::std::core::Class
+  namespace std
   {
-    public:
-
-      explicit StateMachine(const ::std::string& _name);
-      ~StateMachine() override = default;
-
-      bool addState(const ::std::shared_ptr<ls::State> &_state);
-      ::std::shared_ptr<ls::State> getCurrentState();
-      ::std::vector<ls::StateId> getMemory();
-      ::std::string getName();
-      ::std::unordered_map<StateId, ::std::shared_ptr<ls::State>> getStates();
-      bool hasState(const ls::StateId &_id);
-      bool proceed();
-      void setMemory(const ::std::vector<ls::StateId>& _memory);
-      void setName(const ::std::string& _name);
-      bool setStartState(const ls::StateId &_id);
-
-    private:
-
-      ::std::shared_ptr<State> currentState{};
-      ::std::vector<ls::StateId> memory{};
-      ::std::string name{};
-      ::std::unordered_map<ls::StateId, ::std::shared_ptr<ls::State>> states{};
-
-      void _assignMemory(const ::std::vector<ls::StateId>& _memory);
-      void _assignName(const ::std::string& _name);
-      ::std::vector<ls::StateId> _getNextValidStates();
-      void _remember(const ls::StateId &_id);
-      bool _hasState(const ls::StateId &_id);
-  };
+    namespace logic
+    {
+      class StateMachine : public ls::std::core::Class
+      {
+        public:
+
+          explicit StateMachine(const ::std::string &_name);
+          ~StateMachine() override = default;
+
+          bool addState(const ::std::shared_ptr<ls::std::logic::State> &_state);
+          ::std::shared_ptr<ls::std::logic::State> getCurrentState();
+          ::std::vector<ls::std::logic::StateId> getMemory();
+          ::std::string getName();
+          ::std::unordered_map<ls::std::logic::StateId, ::std::shared_ptr<ls::std::logic::State>> getStates();
+          bool hasState(const ls::std::logic::StateId &_id);
+          bool proceed();
+          void setMemory(const ::std::vector<ls::std::logic::StateId> &_memory);
+          void setName(const ::std::string &_name);
+          bool setStartState(const ls::std::logic::StateId &_id);
+
+        private:
+
+          ::std::shared_ptr<ls::std::logic::State> currentState{};
+          ::std::vector<ls::std::logic::StateId> memory{};
+          ::std::string name{};
+          ::std::unordered_map<ls::std::logic::StateId, ::std::shared_ptr<ls::std::logic::State>> states{};
+
+          void _assignMemory(const ::std::vector<ls::std::logic::StateId> &_memory);
+          void _assignName(const ::std::string &_name);
+          ::std::vector<ls::std::logic::StateId> _getNextValidStates();
+          void _remember(const ls::std::logic::StateId &_id);
+          bool _hasState(const ls::std::logic::StateId &_id);
+      };
+    }
+  }
 }
 
 #endif

+ 9 - 3
include/ls_std/logic/StateMachineTypes.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-10
- * Changed:         2022-05-05
+ * Changed:         2022-05-11
  *
  * */
 
@@ -14,8 +14,14 @@
 
 namespace ls
 {
-  using StateConnectionId = ::std::string;
-  using StateId = ::std::string;
+  namespace std
+  {
+    namespace logic
+    {
+      using StateConnectionId = ::std::string;
+      using StateId = ::std::string;
+    }
+  }
 }
 
 #endif

+ 26 - 20
include/ls_std/logic/serialization/SerializableJsonState.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -18,34 +18,40 @@
 
 namespace ls
 {
-  class SerializableJsonState : public ls::std::core::Class, public ls::ISerializable
+  namespace std
   {
-    public:
+    namespace logic
+    {
+      class SerializableJsonState : public ls::std::core::Class, public ls::ISerializable
+      {
+        public:
 
-      explicit SerializableJsonState(const ::std::shared_ptr<ls::State> &_value);
-      ~SerializableJsonState() override = default;
+          explicit SerializableJsonState(const ::std::shared_ptr<ls::std::logic::State> &_value);
+          ~SerializableJsonState() override = default;
 
-      // implementation
+          // implementation
 
-      ls::std::core::byte_field marshal() override;
-      void unmarshal(const ls::std::core::byte_field &_data) override;
+          ls::std::core::byte_field marshal() override;
+          void unmarshal(const ls::std::core::byte_field &_data) override;
 
-      // additional functionality
+          // additional functionality
 
-      ::std::shared_ptr<ls::State> getValue();
-      void setValue(const ::std::shared_ptr<ls::State> &_value);
+          ::std::shared_ptr<ls::std::logic::State> getValue();
+          void setValue(const ::std::shared_ptr<ls::std::logic::State> &_value);
 
-    private:
+        private:
 
-      nlohmann::json jsonObject{};
-      ::std::shared_ptr<ls::State> value{};
+          nlohmann::json jsonObject{};
+          ::std::shared_ptr<ls::std::logic::State> value{};
 
-      void _assignValue(const ::std::shared_ptr<ls::State> &_value);
-      void _clear();
-      void _unmarshalStateConnections();
-      void _update();
-      void _updateStateConnections();
-  };
+          void _assignValue(const ::std::shared_ptr<ls::std::logic::State> &_value);
+          void _clear();
+          void _unmarshalStateConnections();
+          void _update();
+          void _updateStateConnections();
+      };
+    }
+  }
 }
 
 #endif

+ 24 - 18
include/ls_std/logic/serialization/SerializableJsonStateConnection.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -18,32 +18,38 @@
 
 namespace ls
 {
-  class SerializableJsonStateConnection : public ls::std::core::Class, public ls::ISerializable
+  namespace std
   {
-    public:
+    namespace logic
+    {
+      class SerializableJsonStateConnection : public ls::std::core::Class, public ls::ISerializable
+      {
+        public:
 
-      explicit SerializableJsonStateConnection(const ::std::shared_ptr<ls::StateConnection> &_value);
-      ~SerializableJsonStateConnection() override = default;
+          explicit SerializableJsonStateConnection(const ::std::shared_ptr<ls::std::logic::StateConnection> &_value);
+          ~SerializableJsonStateConnection() override = default;
 
-      // implementation
+          // implementation
 
-      ls::std::core::byte_field marshal() override;
-      void unmarshal(const ls::std::core::byte_field &_data) override;
+          ls::std::core::byte_field marshal() override;
+          void unmarshal(const ls::std::core::byte_field &_data) override;
 
-      // additional functionality
+          // additional functionality
 
-      ::std::shared_ptr<ls::StateConnection> getValue();
-      void setValue(const ::std::shared_ptr<ls::StateConnection> &_value);
+          ::std::shared_ptr<ls::std::logic::StateConnection> getValue();
+          void setValue(const ::std::shared_ptr<ls::std::logic::StateConnection> &_value);
 
-    private:
+        private:
 
-      nlohmann::json jsonObject{};
-      ::std::shared_ptr<ls::StateConnection> value{};
+          nlohmann::json jsonObject{};
+          ::std::shared_ptr<ls::std::logic::StateConnection> value{};
 
-      void _assignValue(const ::std::shared_ptr<ls::StateConnection> &_value);
-      void _clear();
-      void _update();
-  };
+          void _assignValue(const ::std::shared_ptr<ls::std::logic::StateConnection> &_value);
+          void _clear();
+          void _update();
+      };
+    }
+  }
 }
 
 #endif

+ 27 - 21
include/ls_std/logic/serialization/SerializableJsonStateMachine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -18,35 +18,41 @@
 
 namespace ls
 {
-  class SerializableJsonStateMachine : public ls::std::core::Class, public ls::ISerializable
+  namespace std
   {
-    public:
+    namespace logic
+    {
+      class SerializableJsonStateMachine : public ls::std::core::Class, public ls::ISerializable
+      {
+        public:
 
-      explicit SerializableJsonStateMachine(const ::std::shared_ptr<ls::StateMachine> &_value);
-      ~SerializableJsonStateMachine() override = default;
+          explicit SerializableJsonStateMachine(const ::std::shared_ptr<ls::std::logic::StateMachine> &_value);
+          ~SerializableJsonStateMachine() override = default;
 
-      // implementation
+          // implementation
 
-      ls::std::core::byte_field marshal() override;
-      void unmarshal(const ls::std::core::byte_field &_data) override;
+          ls::std::core::byte_field marshal() override;
+          void unmarshal(const ls::std::core::byte_field &_data) override;
 
-      // additional functionality
+          // additional functionality
 
-      ::std::shared_ptr<ls::StateMachine> getValue();
-      void setValue(const ::std::shared_ptr<ls::StateMachine> &_value);
+          ::std::shared_ptr<ls::std::logic::StateMachine> getValue();
+          void setValue(const ::std::shared_ptr<ls::std::logic::StateMachine> &_value);
 
-    private:
+        private:
 
-      nlohmann::json jsonObject{};
-      ::std::shared_ptr<ls::StateMachine> value{};
+          nlohmann::json jsonObject{};
+          ::std::shared_ptr<ls::std::logic::StateMachine> value{};
 
-      void _assignValue(const ::std::shared_ptr<ls::StateMachine> &_value);
-      void _unmarshalCurrentState();
-      void _unmarshalStates();
-      void _update();
-      void _updateCurrentState();
-      void _updateStates();
-  };
+          void _assignValue(const ::std::shared_ptr<ls::std::logic::StateMachine> &_value);
+          void _unmarshalCurrentState();
+          void _unmarshalStates();
+          void _update();
+          void _updateCurrentState();
+          void _updateStates();
+      };
+    }
+  }
 }
 
 #endif

+ 2 - 2
source/ls_std/event/EventHandler.cpp

@@ -3,14 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
 #include <ls_std/event/EventHandler.hpp>
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::std::event::EventHandler::EventHandler(const ls::std::event::event_id& _id) : ls::Narrator()
+ls::std::event::EventHandler::EventHandler(const ls::std::event::event_id& _id) : ls::std::logic::Narrator()
 {
   this->_assignId(_id);
 }

+ 3 - 3
source/ls_std/event/EventManager.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -15,7 +15,7 @@
 ls::std::event::EventManager::EventManager() : ls::std::core::Class("EventManager")
 {}
 
-void ls::std::event::EventManager::subscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::IListener> &_listener)
+void ls::std::event::EventManager::subscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::std::logic::IListener> &_listener)
 {
   if (_id.empty() || _listener == nullptr)
   {
@@ -32,7 +32,7 @@ void ls::std::event::EventManager::subscribe(const ls::std::event::event_id &_id
   }
 }
 
-void ls::std::event::EventManager::unsubscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::IListener> &_listener)
+void ls::std::event::EventManager::unsubscribe(const ls::std::event::event_id &_id, const ::std::shared_ptr<ls::std::logic::IListener> &_listener)
 {
   if (_id.empty() || _listener == nullptr)
   {

+ 7 - 7
source/ls_std/logic/Narrator.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -11,10 +11,10 @@
 #include <ls_std/logic/Narrator.hpp>
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::Narrator::Narrator() : ls::std::core::Class("Narrator")
+ls::std::logic::Narrator::Narrator() : ls::std::core::Class("Narrator")
 {}
 
-bool ls::Narrator::addListener(const ::std::shared_ptr<ls::IListener> &_listener)
+bool ls::std::logic::Narrator::addListener(const ::std::shared_ptr<ls::std::logic::IListener> &_listener)
 {
   bool wasAdded{};
 
@@ -34,17 +34,17 @@ bool ls::Narrator::addListener(const ::std::shared_ptr<ls::IListener> &_listener
   return wasAdded;
 }
 
-void ls::Narrator::clear()
+void ls::std::logic::Narrator::clear()
 {
   this->listeners.clear();
 }
 
-std::list<std::shared_ptr<ls::IListener>> ls::Narrator::getListeners()
+std::list<std::shared_ptr<ls::std::logic::IListener>> ls::std::logic::Narrator::getListeners()
 {
   return this->listeners;
 }
 
-bool ls::Narrator::removeListener(const ::std::shared_ptr<ls::IListener> &_listener)
+bool ls::std::logic::Narrator::removeListener(const ::std::shared_ptr<ls::std::logic::IListener> &_listener)
 {
   bool wasRemoved{};
 
@@ -64,7 +64,7 @@ bool ls::Narrator::removeListener(const ::std::shared_ptr<ls::IListener> &_liste
   return wasRemoved;
 }
 
-void ls::Narrator::tell(const ls::std::core::Class &_info)
+void ls::std::logic::Narrator::tell(const ls::std::core::Class &_info)
 {
   for (const auto &listener : this->listeners)
   {

+ 14 - 14
source/ls_std/logic/State.cpp

@@ -3,22 +3,22 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
 #include <ls_std/logic/State.hpp>
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::State::State(const ls::StateId& _id) : ls::std::core::Class("State")
+ls::std::logic::State::State(const ls::std::logic::StateId& _id) : ls::std::core::Class("State")
 {
   this->_assignStateId(_id);
 }
 
-bool ls::State::addStateConnection(const ls::StateConnectionId &_connectionId, const ::std::shared_ptr<ls::State> &_connectedState)
+bool ls::std::logic::State::addStateConnection(const ls::std::logic::StateConnectionId &_connectionId, const ::std::shared_ptr<ls::std::logic::State> &_connectedState)
 {
   bool added{};
-  ::std::shared_ptr<ls::StateConnection> connection{};
+  ::std::shared_ptr<ls::std::logic::StateConnection> connection{};
 
   if (_connectionId.empty() || _connectedState == nullptr)
   {
@@ -28,7 +28,7 @@ bool ls::State::addStateConnection(const ls::StateConnectionId &_connectionId, c
   {
     if (!this->_hasConnection(_connectionId))
     {
-      connection = ::std::make_shared<ls::StateConnection>(_connectionId, _connectedState->getId());
+      connection = ::std::make_shared<ls::std::logic::StateConnection>(_connectionId, _connectedState->getId());
       added = this->connectedStates.insert({_connectionId, connection}).second;
     }
   }
@@ -36,7 +36,7 @@ bool ls::State::addStateConnection(const ls::StateConnectionId &_connectionId, c
   return added;
 }
 
-bool ls::State::addStateConnection(const ::std::shared_ptr<ls::StateConnection> &_connection)
+bool ls::std::logic::State::addStateConnection(const ::std::shared_ptr<ls::std::logic::StateConnection> &_connection)
 {
   bool added;
 
@@ -52,32 +52,32 @@ bool ls::State::addStateConnection(const ::std::shared_ptr<ls::StateConnection>
   return added;
 }
 
-void ls::State::clearConnections()
+void ls::std::logic::State::clearConnections()
 {
   this->_clearConnections();
 }
 
-std::unordered_map<ls::StateConnectionId, std::shared_ptr<ls::StateConnection>> ls::State::getConnectedStates()
+std::unordered_map<ls::std::logic::StateConnectionId, std::shared_ptr<ls::std::logic::StateConnection>> ls::std::logic::State::getConnectedStates()
 {
   return this->connectedStates;
 }
 
-ls::StateId ls::State::getId()
+ls::std::logic::StateId ls::std::logic::State::getId()
 {
   return this->id;
 }
 
-bool ls::State::hasConnection(const ls::StateConnectionId &_connectionId)
+bool ls::std::logic::State::hasConnection(const ls::std::logic::StateConnectionId &_connectionId)
 {
   return this->_hasConnection(_connectionId);
 }
 
-void ls::State::setId(const ls::StateId& _id)
+void ls::std::logic::State::setId(const ls::std::logic::StateId& _id)
 {
   this->_assignStateId(_id);
 }
 
-void ls::State::_assignStateId(const ls::StateId &_id)
+void ls::std::logic::State::_assignStateId(const ls::std::logic::StateId &_id)
 {
   if (_id.empty())
   {
@@ -87,12 +87,12 @@ void ls::State::_assignStateId(const ls::StateId &_id)
   this->id = _id;
 }
 
-void ls::State::_clearConnections()
+void ls::std::logic::State::_clearConnections()
 {
   this->connectedStates.clear();
 }
 
-bool ls::State::_hasConnection(const ls::StateConnectionId &_connectionId)
+bool ls::std::logic::State::_hasConnection(const ls::std::logic::StateConnectionId &_connectionId)
 {
   return this->connectedStates.find(_connectionId) != this->connectedStates.end();
 }

+ 10 - 10
source/ls_std/logic/StateConnection.cpp

@@ -3,50 +3,50 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-10
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
 #include <ls_std/logic/StateConnection.hpp>
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::StateConnection::StateConnection(const ls::StateConnectionId& _connectionId, const ls::StateId& _stateId) : ls::std::core::Class("StateConnection")
+ls::std::logic::StateConnection::StateConnection(const ls::std::logic::StateConnectionId& _connectionId, const ls::std::logic::StateId& _stateId) : ls::std::core::Class("StateConnection")
 {
   this->_assignConnectionId(_connectionId);
   this->_assignStateId(_stateId);
 }
 
-ls::StateConnectionId ls::StateConnection::getConnectionId()
+ls::std::logic::StateConnectionId ls::std::logic::StateConnection::getConnectionId()
 {
   return this->connectionId;
 }
 
-ls::StateId ls::StateConnection::getStateId()
+ls::std::logic::StateId ls::std::logic::StateConnection::getStateId()
 {
   return this->stateId;
 }
 
-bool ls::StateConnection::isPassable() const
+bool ls::std::logic::StateConnection::isPassable() const
 {
   return this->condition;
 }
 
-void ls::StateConnection::setConnectionId(const ls::StateConnectionId& _connectionId)
+void ls::std::logic::StateConnection::setConnectionId(const ls::std::logic::StateConnectionId& _connectionId)
 {
   this->_assignConnectionId(_connectionId);
 }
 
-void ls::StateConnection::setStateId(const ls::StateId& _stateId)
+void ls::std::logic::StateConnection::setStateId(const ls::std::logic::StateId& _stateId)
 {
   this->_assignStateId(_stateId);
 }
 
-void ls::StateConnection::updatePassCondition(bool _condition)
+void ls::std::logic::StateConnection::updatePassCondition(bool _condition)
 {
   this->condition = _condition;
 }
 
-void ls::StateConnection::_assignConnectionId(const ls::StateConnectionId &_connectionId)
+void ls::std::logic::StateConnection::_assignConnectionId(const ls::std::logic::StateConnectionId &_connectionId)
 {
   if (_connectionId.empty())
   {
@@ -56,7 +56,7 @@ void ls::StateConnection::_assignConnectionId(const ls::StateConnectionId &_conn
   this->connectionId = _connectionId;
 }
 
-void ls::StateConnection::_assignStateId(const ls::StateId &_stateId)
+void ls::std::logic::StateConnection::_assignStateId(const ls::std::logic::StateId &_stateId)
 {
   if (_stateId.empty())
   {

+ 19 - 19
source/ls_std/logic/StateMachine.cpp

@@ -3,19 +3,19 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
 #include <ls_std/logic/StateMachine.hpp>
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::StateMachine::StateMachine(const ::std::string& _name) : ls::std::core::Class("StateMachine")
+ls::std::logic::StateMachine::StateMachine(const ::std::string& _name) : ls::std::core::Class("StateMachine")
 {
   this->_assignName(_name);
 }
 
-bool ls::StateMachine::addState(const ::std::shared_ptr<ls::State> &_state)
+bool ls::std::logic::StateMachine::addState(const ::std::shared_ptr<ls::std::logic::State> &_state)
 {
   bool wasAdded{};
 
@@ -34,34 +34,34 @@ bool ls::StateMachine::addState(const ::std::shared_ptr<ls::State> &_state)
   return wasAdded;
 }
 
-std::shared_ptr<ls::State> ls::StateMachine::getCurrentState()
+std::shared_ptr<ls::std::logic::State> ls::std::logic::StateMachine::getCurrentState()
 {
   return this->currentState;
 }
 
-std::vector<ls::StateId> ls::StateMachine::getMemory()
+std::vector<ls::std::logic::StateId> ls::std::logic::StateMachine::getMemory()
 {
   return this->memory;
 }
 
-std::string ls::StateMachine::getName()
+std::string ls::std::logic::StateMachine::getName()
 {
   return this->name;
 }
 
-std::unordered_map<ls::StateId, std::shared_ptr<ls::State>> ls::StateMachine::getStates()
+std::unordered_map<ls::std::logic::StateId, std::shared_ptr<ls::std::logic::State>> ls::std::logic::StateMachine::getStates()
 {
   return this->states;
 }
 
-bool ls::StateMachine::hasState(const ls::StateId &_id)
+bool ls::std::logic::StateMachine::hasState(const ls::std::logic::StateId &_id)
 {
   return this->_hasState(_id);
 }
 
-bool ls::StateMachine::proceed()
+bool ls::std::logic::StateMachine::proceed()
 {
-  ::std::vector<ls::StateId> nextValidStates = this->_getNextValidStates();
+  ::std::vector<ls::std::logic::StateId> nextValidStates = this->_getNextValidStates();
   bool onlyOneWayToGo = nextValidStates.size() == 1;
 
   if (onlyOneWayToGo)
@@ -73,17 +73,17 @@ bool ls::StateMachine::proceed()
   return onlyOneWayToGo;
 }
 
-void ls::StateMachine::setMemory(const ::std::vector<ls::StateId>& _memory)
+void ls::std::logic::StateMachine::setMemory(const ::std::vector<ls::std::logic::StateId>& _memory)
 {
   this->_assignMemory(_memory);
 }
 
-void ls::StateMachine::setName(const ::std::string& _name)
+void ls::std::logic::StateMachine::setName(const ::std::string& _name)
 {
   this->_assignName(_name);
 }
 
-bool ls::StateMachine::setStartState(const ls::StateId &_id)
+bool ls::std::logic::StateMachine::setStartState(const ls::std::logic::StateId &_id)
 {
   bool startStateSet{};
 
@@ -104,7 +104,7 @@ bool ls::StateMachine::setStartState(const ls::StateId &_id)
   return startStateSet;
 }
 
-void ls::StateMachine::_assignMemory(const ::std::vector<ls::StateId> &_memory)
+void ls::std::logic::StateMachine::_assignMemory(const ::std::vector<ls::std::logic::StateId> &_memory)
 {
   if (_memory.empty())
   {
@@ -114,7 +114,7 @@ void ls::StateMachine::_assignMemory(const ::std::vector<ls::StateId> &_memory)
   this->memory = _memory;
 }
 
-void ls::StateMachine::_assignName(const ::std::string &_name)
+void ls::std::logic::StateMachine::_assignName(const ::std::string &_name)
 {
   if (_name.empty())
   {
@@ -124,9 +124,9 @@ void ls::StateMachine::_assignName(const ::std::string &_name)
   this->name = _name;
 }
 
-std::vector<ls::StateId> ls::StateMachine::_getNextValidStates()
+std::vector<ls::std::logic::StateId> ls::std::logic::StateMachine::_getNextValidStates()
 {
-  ::std::vector<ls::StateId> validStates{};
+  ::std::vector<ls::std::logic::StateId> validStates{};
 
   for (const auto &state : this->currentState->getConnectedStates())
   {
@@ -139,12 +139,12 @@ std::vector<ls::StateId> ls::StateMachine::_getNextValidStates()
   return validStates;
 }
 
-void ls::StateMachine::_remember(const ls::StateId &_id)
+void ls::std::logic::StateMachine::_remember(const ls::std::logic::StateId &_id)
 {
   this->memory.push_back(_id);
 }
 
-bool ls::StateMachine::_hasState(const ls::StateId &_id)
+bool ls::std::logic::StateMachine::_hasState(const ls::std::logic::StateId &_id)
 {
   return this->states.find(_id) != this->states.end();
 }

+ 14 - 14
source/ls_std/logic/serialization/SerializableJsonState.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -11,18 +11,18 @@
 #include "ls_std/logic/serialization/SerializableJsonStateConnection.hpp"
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::SerializableJsonState::SerializableJsonState(const ::std::shared_ptr<ls::State> &_value) : ls::std::core::Class("SerializableJsonState")
+ls::std::logic::SerializableJsonState::SerializableJsonState(const ::std::shared_ptr<ls::std::logic::State> &_value) : ls::std::core::Class("SerializableJsonState")
 {
   this->_assignValue(_value);
 }
 
-ls::std::core::byte_field ls::SerializableJsonState::marshal()
+ls::std::core::byte_field ls::std::logic::SerializableJsonState::marshal()
 {
   this->_update();
   return this->jsonObject.dump();
 }
 
-void ls::SerializableJsonState::unmarshal(const ls::std::core::byte_field &_data)
+void ls::std::logic::SerializableJsonState::unmarshal(const ls::std::core::byte_field &_data)
 {
   this->jsonObject = nlohmann::json::parse(_data);
 
@@ -30,18 +30,18 @@ void ls::SerializableJsonState::unmarshal(const ls::std::core::byte_field &_data
   this->value->setId(this->jsonObject["id"]);
 }
 
-std::shared_ptr<ls::State> ls::SerializableJsonState::getValue()
+std::shared_ptr<ls::std::logic::State> ls::std::logic::SerializableJsonState::getValue()
 {
   return this->value;
 }
 
-void ls::SerializableJsonState::setValue(const ::std::shared_ptr<ls::State> &_value)
+void ls::std::logic::SerializableJsonState::setValue(const ::std::shared_ptr<ls::std::logic::State> &_value)
 {
   this->_assignValue(_value);
   this->_clear();
 }
 
-void ls::SerializableJsonState::_assignValue(const ::std::shared_ptr<ls::State> &_value)
+void ls::std::logic::SerializableJsonState::_assignValue(const ::std::shared_ptr<ls::std::logic::State> &_value)
 {
   if (_value == nullptr)
   {
@@ -51,12 +51,12 @@ void ls::SerializableJsonState::_assignValue(const ::std::shared_ptr<ls::State>
   this->value = _value;
 }
 
-void ls::SerializableJsonState::_clear()
+void ls::std::logic::SerializableJsonState::_clear()
 {
   this->jsonObject.clear();
 }
 
-void ls::SerializableJsonState::_unmarshalStateConnections()
+void ls::std::logic::SerializableJsonState::_unmarshalStateConnections()
 {
   if (!this->jsonObject["connectedStates"].empty())
   {
@@ -64,27 +64,27 @@ void ls::SerializableJsonState::_unmarshalStateConnections()
 
     for (const auto &connectionJson : this->jsonObject["connectedStates"])
     {
-      ::std::shared_ptr<ls::StateConnection> connection = ::std::make_shared<ls::StateConnection>("TMP_ID", "TMP_ID");
-      ls::SerializableJsonStateConnection{connection}.unmarshal(connectionJson.dump());
+      ::std::shared_ptr<ls::std::logic::StateConnection> connection = ::std::make_shared<ls::std::logic::StateConnection>("TMP_ID", "TMP_ID");
+      ls::std::logic::SerializableJsonStateConnection{connection}.unmarshal(connectionJson.dump());
       this->value->addStateConnection(connection);
     }
   }
 }
 
-void ls::SerializableJsonState::_update()
+void ls::std::logic::SerializableJsonState::_update()
 {
   this->jsonObject = {{"id", this->value->getId()}};
 
   this->_updateStateConnections();
 }
 
-void ls::SerializableJsonState::_updateStateConnections()
+void ls::std::logic::SerializableJsonState::_updateStateConnections()
 {
   ::std::string jsonString{};
 
   for (const auto &connection : this->value->getConnectedStates())
   {
-    jsonString = ls::SerializableJsonStateConnection{connection.second}.marshal();
+    jsonString = ls::std::logic::SerializableJsonStateConnection{connection.second}.marshal();
     this->jsonObject["connectedStates"][connection.first] = nlohmann::json::parse(jsonString);
   }
 }

+ 9 - 9
source/ls_std/logic/serialization/SerializableJsonStateConnection.cpp

@@ -3,25 +3,25 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
 #include "ls_std/logic/serialization/SerializableJsonStateConnection.hpp"
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::SerializableJsonStateConnection::SerializableJsonStateConnection(const ::std::shared_ptr<ls::StateConnection> &_value) : ls::std::core::Class("SerializableJsonStateConnection")
+ls::std::logic::SerializableJsonStateConnection::SerializableJsonStateConnection(const ::std::shared_ptr<ls::std::logic::StateConnection> &_value) : ls::std::core::Class("SerializableJsonStateConnection")
 {
   this->_assignValue(_value);
 }
 
-ls::std::core::byte_field ls::SerializableJsonStateConnection::marshal()
+ls::std::core::byte_field ls::std::logic::SerializableJsonStateConnection::marshal()
 {
   this->_update();
   return this->jsonObject.dump();
 }
 
-void ls::SerializableJsonStateConnection::unmarshal(const ls::std::core::byte_field &_data)
+void ls::std::logic::SerializableJsonStateConnection::unmarshal(const ls::std::core::byte_field &_data)
 {
   ::std::string jsonString = ::std::string(_data);
   this->jsonObject = nlohmann::json::parse(jsonString);
@@ -31,18 +31,18 @@ void ls::SerializableJsonStateConnection::unmarshal(const ls::std::core::byte_fi
   this->value->updatePassCondition(this->jsonObject["condition"]);
 }
 
-std::shared_ptr<ls::StateConnection> ls::SerializableJsonStateConnection::getValue()
+std::shared_ptr<ls::std::logic::StateConnection> ls::std::logic::SerializableJsonStateConnection::getValue()
 {
   return this->value;
 }
 
-void ls::SerializableJsonStateConnection::setValue(const ::std::shared_ptr<ls::StateConnection> &_value)
+void ls::std::logic::SerializableJsonStateConnection::setValue(const ::std::shared_ptr<ls::std::logic::StateConnection> &_value)
 {
   this->_assignValue(_value);
   this->_clear();
 }
 
-void ls::SerializableJsonStateConnection::_assignValue(const ::std::shared_ptr<ls::StateConnection> &_value)
+void ls::std::logic::SerializableJsonStateConnection::_assignValue(const ::std::shared_ptr<ls::std::logic::StateConnection> &_value)
 {
   if (_value == nullptr)
   {
@@ -52,12 +52,12 @@ void ls::SerializableJsonStateConnection::_assignValue(const ::std::shared_ptr<l
   this->value = _value;
 }
 
-void ls::SerializableJsonStateConnection::_clear()
+void ls::std::logic::SerializableJsonStateConnection::_clear()
 {
   this->jsonObject.clear();
 }
 
-void ls::SerializableJsonStateConnection::_update()
+void ls::std::logic::SerializableJsonStateConnection::_update()
 {
   this->jsonObject = {{"condition",    this->value->isPassable()},
                       {"connectionId", this->value->getConnectionId()},

+ 15 - 15
source/ls_std/logic/serialization/SerializableJsonStateMachine.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -11,18 +11,18 @@
 #include "ls_std/logic/serialization/SerializableJsonState.hpp"
 #include <ls_std/core/exception/IllegalArgumentException.hpp>
 
-ls::SerializableJsonStateMachine::SerializableJsonStateMachine(const ::std::shared_ptr<ls::StateMachine> &_value) : ls::std::core::Class("SerializableJsonStateMachine")
+ls::std::logic::SerializableJsonStateMachine::SerializableJsonStateMachine(const ::std::shared_ptr<ls::std::logic::StateMachine> &_value) : ls::std::core::Class("SerializableJsonStateMachine")
 {
   this->_assignValue(_value);
 }
 
-ls::std::core::byte_field ls::SerializableJsonStateMachine::marshal()
+ls::std::core::byte_field ls::std::logic::SerializableJsonStateMachine::marshal()
 {
   this->_update();
   return this->jsonObject.dump();
 }
 
-void ls::SerializableJsonStateMachine::unmarshal(const ls::std::core::byte_field &_data)
+void ls::std::logic::SerializableJsonStateMachine::unmarshal(const ls::std::core::byte_field &_data)
 {
   this->jsonObject = nlohmann::json::parse(_data);
 
@@ -32,17 +32,17 @@ void ls::SerializableJsonStateMachine::unmarshal(const ls::std::core::byte_field
   this->value->setName(this->jsonObject["name"]);
 }
 
-std::shared_ptr<ls::StateMachine> ls::SerializableJsonStateMachine::getValue()
+std::shared_ptr<ls::std::logic::StateMachine> ls::std::logic::SerializableJsonStateMachine::getValue()
 {
   return this->value;
 }
 
-void ls::SerializableJsonStateMachine::setValue(const ::std::shared_ptr<ls::StateMachine> &_value)
+void ls::std::logic::SerializableJsonStateMachine::setValue(const ::std::shared_ptr<ls::std::logic::StateMachine> &_value)
 {
   this->_assignValue(_value);
 }
 
-void ls::SerializableJsonStateMachine::_assignValue(const ::std::shared_ptr<ls::StateMachine> &_value)
+void ls::std::logic::SerializableJsonStateMachine::_assignValue(const ::std::shared_ptr<ls::std::logic::StateMachine> &_value)
 {
   if (_value == nullptr)
   {
@@ -52,7 +52,7 @@ void ls::SerializableJsonStateMachine::_assignValue(const ::std::shared_ptr<ls::
   this->value = _value;
 }
 
-void ls::SerializableJsonStateMachine::_unmarshalCurrentState()
+void ls::std::logic::SerializableJsonStateMachine::_unmarshalCurrentState()
 {
   if (this->jsonObject.contains("currentState"))
   {
@@ -60,17 +60,17 @@ void ls::SerializableJsonStateMachine::_unmarshalCurrentState()
   }
 }
 
-void ls::SerializableJsonStateMachine::_unmarshalStates()
+void ls::std::logic::SerializableJsonStateMachine::_unmarshalStates()
 {
   for (const auto &serializedState : this->jsonObject["states"])
   {
-    ::std::shared_ptr<ls::State> state = ::std::make_shared<ls::State>("TMP_ID");
-    ls::SerializableJsonState{state}.unmarshal(serializedState.dump());
+    ::std::shared_ptr<ls::std::logic::State> state = ::std::make_shared<ls::std::logic::State>("TMP_ID");
+    ls::std::logic::SerializableJsonState{state}.unmarshal(serializedState.dump());
     this->value->addState(state);
   }
 }
 
-void ls::SerializableJsonStateMachine::_update()
+void ls::std::logic::SerializableJsonStateMachine::_update()
 {
   this->jsonObject = {{"memory", this->value->getMemory()},
                       {"name",   this->value->getName()}};
@@ -79,7 +79,7 @@ void ls::SerializableJsonStateMachine::_update()
   this->_updateStates();
 }
 
-void ls::SerializableJsonStateMachine::_updateCurrentState()
+void ls::std::logic::SerializableJsonStateMachine::_updateCurrentState()
 {
   if (this->value->getCurrentState() != nullptr)
   {
@@ -87,13 +87,13 @@ void ls::SerializableJsonStateMachine::_updateCurrentState()
   }
 }
 
-void ls::SerializableJsonStateMachine::_updateStates()
+void ls::std::logic::SerializableJsonStateMachine::_updateStates()
 {
   ::std::string jsonString{};
 
   for (const auto &state : this->value->getStates())
   {
-    jsonString = ls::SerializableJsonState{state.second}.marshal();
+    jsonString = ls::std::logic::SerializableJsonState{state.second}.marshal();
     this->jsonObject["states"][state.first] = nlohmann::json::parse(jsonString);
   }
 }

+ 7 - 7
test/TestDataFactory.cpp

@@ -9,15 +9,15 @@
 
 #include "TestDataFactory.hpp"
 
-ls::StateMachine ls_std_test::TestDataFactory::createStateMachine()
+ls::std::logic::StateMachine ls_std_test::TestDataFactory::createStateMachine()
 {
-  ls::StateMachine stateMachine{"test_machine"};
+  ls::std::logic::StateMachine stateMachine{"test_machine"};
 
-  std::shared_ptr<ls::State> stateA = std::make_shared<ls::State>("A");
-  std::shared_ptr<ls::State> stateB = std::make_shared<ls::State>("B");
-  std::shared_ptr<ls::State> stateC = std::make_shared<ls::State>("C");
-  std::shared_ptr<ls::State> stateD = std::make_shared<ls::State>("D");
-  std::shared_ptr<ls::State> stateE = std::make_shared<ls::State>("E");
+  std::shared_ptr<ls::std::logic::State> stateA = std::make_shared<ls::std::logic::State>("A");
+  std::shared_ptr<ls::std::logic::State> stateB = std::make_shared<ls::std::logic::State>("B");
+  std::shared_ptr<ls::std::logic::State> stateC = std::make_shared<ls::std::logic::State>("C");
+  std::shared_ptr<ls::std::logic::State> stateD = std::make_shared<ls::std::logic::State>("D");
+  std::shared_ptr<ls::std::logic::State> stateE = std::make_shared<ls::std::logic::State>("E");
 
   // add states
 

+ 1 - 1
test/TestDataFactory.hpp

@@ -21,7 +21,7 @@ namespace ls_std_test
       TestDataFactory() = default;
       ~TestDataFactory() = default;
 
-      static ls::StateMachine createStateMachine();
+      static ls::std::logic::StateMachine createStateMachine();
       static std::shared_ptr<ls::std::io::XmlNode> createXmlContent();
   };
 }

+ 24 - 24
test/cases/logic/NarratorTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -44,20 +44,20 @@ namespace
   TEST_F(NarratorTest, addListener)
   {
     this->createCars();
-    ls::Narrator paintingMachine{};
+    ls::std::logic::Narrator paintingMachine{};
 
-    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes1)));
-    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes2)));
-    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes3)));
+    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes1)));
+    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes2)));
+    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes3)));
   }
 
   TEST_F(NarratorTest, addListener_listener_already_exists)
   {
     this->createCars();
-    ls::Narrator paintingMachine{};
+    ls::std::logic::Narrator paintingMachine{};
 
-    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes1)));
-    ASSERT_FALSE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes1)));
+    ASSERT_TRUE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes1)));
+    ASSERT_FALSE(paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes1)));
   }
 
   TEST_F(NarratorTest, addListener_no_reference)
@@ -65,7 +65,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::Narrator paintingMachine{};
+                     ls::std::logic::Narrator paintingMachine{};
                      paintingMachine.addListener(nullptr);
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
@@ -78,10 +78,10 @@ namespace
   TEST_F(NarratorTest, clear)
   {
     this->createCars();
-    ls::Narrator paintingMachine{};
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes1));
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes2));
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes3));
+    ls::std::logic::Narrator paintingMachine{};
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes1));
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes2));
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes3));
 
     ASSERT_FALSE(paintingMachine.getListeners().empty());
     paintingMachine.clear();
@@ -90,17 +90,17 @@ namespace
 
   TEST_F(NarratorTest, getListeners)
   {
-    ls::Narrator narrator{};
+    ls::std::logic::Narrator narrator{};
     ASSERT_TRUE(narrator.getListeners().empty());
   }
 
   TEST_F(NarratorTest, removeListener)
   {
     this->createCars();
-    ls::Narrator paintingMachine{};
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes1));
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes2));
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes3));
+    ls::std::logic::Narrator paintingMachine{};
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes1));
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes2));
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes3));
 
     ASSERT_TRUE(paintingMachine.removeListener(this->mercedes2));
     ASSERT_TRUE(paintingMachine.removeListener(this->mercedes1));
@@ -111,7 +111,7 @@ namespace
   TEST_F(NarratorTest, removeListener_no_listener_available)
   {
     this->createCars();
-    ls::Narrator paintingMachine{};
+    ls::std::logic::Narrator paintingMachine{};
     ASSERT_FALSE(paintingMachine.removeListener(this->mercedes2));
   }
 
@@ -120,7 +120,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::Narrator paintingMachine{};
+                     ls::std::logic::Narrator paintingMachine{};
                      paintingMachine.removeListener(nullptr);
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
@@ -133,10 +133,10 @@ namespace
   TEST_F(NarratorTest, tell)
   {
     this->createCars();
-    ls::Narrator paintingMachine{};
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes1));
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes2));
-    paintingMachine.addListener(std::dynamic_pointer_cast<ls::IListener>(this->mercedes3));
+    ls::std::logic::Narrator paintingMachine{};
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes1));
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes2));
+    paintingMachine.addListener(std::dynamic_pointer_cast<ls::std::logic::IListener>(this->mercedes3));
 
     ASSERT_STREQ("pink", this->mercedes1->getColor().c_str());
     ASSERT_STREQ("blue", this->mercedes2->getColor().c_str());

+ 12 - 12
test/cases/logic/StateConnectionTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-10
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -28,7 +28,7 @@ namespace
 
   TEST_F(StateConnectionTest, getClassName)
   {
-    ls::StateConnection connection{"AB", "B"};
+    ls::std::logic::StateConnection connection{"AB", "B"};
     ASSERT_STREQ("StateConnection", connection.getClassName().c_str());
   }
 
@@ -37,7 +37,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::StateConnection connection = ls::StateConnection("", "B");
+                     ls::std::logic::StateConnection connection = ls::std::logic::StateConnection("", "B");
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -51,7 +51,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::StateConnection connection = ls::StateConnection("AB", "");
+                     ls::std::logic::StateConnection connection = ls::std::logic::StateConnection("AB", "");
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -62,25 +62,25 @@ namespace
 
   TEST_F(StateConnectionTest, getConnectionId)
   {
-    ls::StateConnection connection{"AB", "B"};
+    ls::std::logic::StateConnection connection{"AB", "B"};
     ASSERT_STREQ("AB", connection.getConnectionId().c_str());
   }
 
   TEST_F(StateConnectionTest, getStateId)
   {
-    ls::StateConnection connection{"AB", "B"};
+    ls::std::logic::StateConnection connection{"AB", "B"};
     ASSERT_STREQ("B", connection.getStateId().c_str());
   }
 
   TEST_F(StateConnectionTest, isPassable)
   {
-    ls::StateConnection connection{"AB", "B"};
+    ls::std::logic::StateConnection connection{"AB", "B"};
     ASSERT_FALSE(connection.isPassable());
   }
 
   TEST_F(StateConnectionTest, setConnectionId)
   {
-    ls::StateConnection connection{"AB", "B"};
+    ls::std::logic::StateConnection connection{"AB", "B"};
     ASSERT_STREQ("AB", connection.getConnectionId().c_str());
 
     connection.setConnectionId("BC");
@@ -92,7 +92,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::StateConnection connection = ls::StateConnection("AB", "B");
+                     ls::std::logic::StateConnection connection = ls::std::logic::StateConnection("AB", "B");
                      connection.setConnectionId("");
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
@@ -104,7 +104,7 @@ namespace
 
   TEST_F(StateConnectionTest, setStateId)
   {
-    ls::StateConnection connection{"AB", "B"};
+    ls::std::logic::StateConnection connection{"AB", "B"};
     ASSERT_STREQ("B", connection.getStateId().c_str());
 
     connection.setStateId("C");
@@ -116,7 +116,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::StateConnection connection = ls::StateConnection("AB", "B");
+                     ls::std::logic::StateConnection connection = ls::std::logic::StateConnection("AB", "B");
                      connection.setStateId("");
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
@@ -128,7 +128,7 @@ namespace
 
   TEST_F(StateConnectionTest, updatePassCondition)
   {
-    ls::StateConnection connection{"AB", "B"};
+    ls::std::logic::StateConnection connection{"AB", "B"};
 
     ASSERT_FALSE(connection.isPassable());
     connection.updatePassCondition(true);

+ 25 - 25
test/cases/logic/StateMachineTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-09
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -29,7 +29,7 @@ namespace
 
   TEST_F(StateMachineTest, getClassName)
   {
-    ls::StateMachine stateMachine {"machine"};
+    ls::std::logic::StateMachine stateMachine {"machine"};
     ASSERT_STREQ("StateMachine", stateMachine.getClassName().c_str());
   }
 
@@ -38,7 +38,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::StateMachine stateMachine {""};
+                     ls::std::logic::StateMachine stateMachine {""};
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -49,15 +49,15 @@ namespace
 
   TEST_F(StateMachineTest, addState)
   {
-    ls::StateMachine stateMachine{"test_machine"};
-    ASSERT_TRUE(stateMachine.addState(std::make_shared<ls::State>("A")));
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
+    ASSERT_TRUE(stateMachine.addState(std::make_shared<ls::std::logic::State>("A")));
   }
 
   TEST_F(StateMachineTest, addState_state_already_exists)
   {
-    ls::StateMachine stateMachine{"test_machine"};
-    ASSERT_TRUE(stateMachine.addState(std::make_shared<ls::State>("A")));
-    ASSERT_FALSE(stateMachine.addState(std::make_shared<ls::State>("A")));
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
+    ASSERT_TRUE(stateMachine.addState(std::make_shared<ls::std::logic::State>("A")));
+    ASSERT_FALSE(stateMachine.addState(std::make_shared<ls::std::logic::State>("A")));
   }
 
   TEST_F(StateMachineTest, addState_no_reference)
@@ -65,7 +65,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::StateMachine stateMachine{"test_machine"};
+                     ls::std::logic::StateMachine stateMachine{"test_machine"};
                      stateMachine.addState(nullptr);
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
@@ -77,33 +77,33 @@ namespace
 
   TEST_F(StateMachineTest, getCurrentState)
   {
-    ls::StateMachine stateMachine{"test_machine"};
-    ASSERT_TRUE(stateMachine.addState(std::make_shared<ls::State>("A")));
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
+    ASSERT_TRUE(stateMachine.addState(std::make_shared<ls::std::logic::State>("A")));
 
     ASSERT_TRUE(stateMachine.getCurrentState() == nullptr);
   }
 
   TEST_F(StateMachineTest, getMemory)
   {
-    ls::StateMachine stateMachine {"machine"};
+    ls::std::logic::StateMachine stateMachine {"machine"};
     ASSERT_TRUE(stateMachine.getMemory().empty());
   }
 
   TEST_F(StateMachineTest, getName)
   {
-    ls::StateMachine stateMachine{"test_machine"};
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
     ASSERT_STREQ("test_machine", stateMachine.getName().c_str());
   }
 
   TEST_F(StateMachineTest, getStates)
   {
-    ls::StateMachine stateMachine {"machine"};
+    ls::std::logic::StateMachine stateMachine {"machine"};
     ASSERT_TRUE(stateMachine.getStates().empty());
   }
 
   TEST_F(StateMachineTest, hasState)
   {
-    ls::StateMachine stateMachine = ls_std_test::TestDataFactory::createStateMachine();
+    ls::std::logic::StateMachine stateMachine = ls_std_test::TestDataFactory::createStateMachine();
 
     ASSERT_TRUE(stateMachine.hasState("A"));
     ASSERT_TRUE(stateMachine.hasState("B"));
@@ -114,13 +114,13 @@ namespace
 
   TEST_F(StateMachineTest, hasState_no_state_available)
   {
-    ls::StateMachine stateMachine {"machine"};
+    ls::std::logic::StateMachine stateMachine {"machine"};
     ASSERT_FALSE(stateMachine.hasState("F"));
   }
 
   TEST_F(StateMachineTest, proceed)
   {
-    ls::StateMachine stateMachine = ls_std_test::TestDataFactory::createStateMachine();
+    ls::std::logic::StateMachine stateMachine = ls_std_test::TestDataFactory::createStateMachine();
     ASSERT_STREQ("test_machine", stateMachine.getName().c_str());
     ASSERT_TRUE(stateMachine.setStartState("A"));
 
@@ -171,8 +171,8 @@ namespace
 
   TEST_F(StateMachineTest, setMemory_no_memory)
   {
-    ls::StateMachine stateMachine{"test_machine"};
-    std::vector<ls::StateId> memory{};
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
+    std::vector<ls::std::logic::StateId> memory{};
 
     EXPECT_THROW({
                    try
@@ -188,7 +188,7 @@ namespace
 
   TEST_F(StateMachineTest, setName)
   {
-    ls::StateMachine stateMachine{"test_machine"};
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
     ASSERT_STREQ("test_machine", stateMachine.getName().c_str());
 
     stateMachine.setName("bla");
@@ -200,7 +200,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::StateMachine stateMachine {"machine"};
+                     ls::std::logic::StateMachine stateMachine {"machine"};
                      stateMachine.setName("");
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
@@ -212,9 +212,9 @@ namespace
 
   TEST_F(StateMachineTest, setStartState)
   {
-    ls::StateMachine stateMachine{"test_machine"};
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
     ASSERT_TRUE(stateMachine.getCurrentState() == nullptr);
-    stateMachine.addState(std::make_shared<ls::State>("A"));
+    stateMachine.addState(std::make_shared<ls::std::logic::State>("A"));
 
     ASSERT_TRUE(stateMachine.setStartState("A"));
     ASSERT_FALSE(stateMachine.getCurrentState() == nullptr);
@@ -222,13 +222,13 @@ namespace
 
   TEST_F(StateMachineTest, setStartState_state_does_not_exist)
   {
-    ls::StateMachine stateMachine{"test_machine"};
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
     ASSERT_FALSE(stateMachine.setStartState("A"));
   }
 
   TEST_F(StateMachineTest, setStartState_empty_id)
   {
-    ls::StateMachine stateMachine{"test_machine"};
+    ls::std::logic::StateMachine stateMachine{"test_machine"};
 
     EXPECT_THROW({
                    try

+ 30 - 30
test/cases/logic/StateTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -29,7 +29,7 @@ namespace
 
   TEST_F(StateTest, getClassName)
   {
-    ls::State state{"A"};
+    ls::std::logic::State state{"A"};
     ASSERT_STREQ("State", state.getClassName().c_str());
   }
 
@@ -38,7 +38,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::State state = ls::State("");
+                     ls::std::logic::State state = ls::std::logic::State("");
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -51,29 +51,29 @@ namespace
 
   TEST_F(StateTest, addStateConnection_v1)
   {
-    ls::State stateA{"A"};
-    ls::State stateB{"B"};
+    ls::std::logic::State stateA{"A"};
+    ls::std::logic::State stateB{"B"};
 
-    ASSERT_TRUE(stateA.addStateConnection("AB", std::make_shared<ls::State>(stateB)));
+    ASSERT_TRUE(stateA.addStateConnection("AB", std::make_shared<ls::std::logic::State>(stateB)));
   }
 
   TEST_F(StateTest, addStateConnection_v1_connection_already_exists)
   {
-    ls::State stateA{"A"};
-    ls::State stateB{"B"};
+    ls::std::logic::State stateA{"A"};
+    ls::std::logic::State stateB{"B"};
 
-    ASSERT_TRUE(stateA.addStateConnection("AB", std::make_shared<ls::State>(stateB)));
-    ASSERT_FALSE(stateA.addStateConnection("AB", std::make_shared<ls::State>(stateB)));
+    ASSERT_TRUE(stateA.addStateConnection("AB", std::make_shared<ls::std::logic::State>(stateB)));
+    ASSERT_FALSE(stateA.addStateConnection("AB", std::make_shared<ls::std::logic::State>(stateB)));
   }
 
   TEST_F(StateTest, addStateConnection_v1_empty_connection_id)
   {
-    ls::State state{"A"};
+    ls::std::logic::State state{"A"};
 
     EXPECT_THROW({
                    try
                    {
-                     state.addStateConnection("", std::make_shared<ls::State>("B"));
+                     state.addStateConnection("", std::make_shared<ls::std::logic::State>("B"));
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -84,7 +84,7 @@ namespace
 
   TEST_F(StateTest, addStateConnection_v1_no_reference)
   {
-    ls::State state{"A"};
+    ls::std::logic::State state{"A"};
 
     EXPECT_THROW({
                    try
@@ -100,15 +100,15 @@ namespace
 
   TEST_F(StateTest, addStateConnection_v2)
   {
-    ls::State stateA{"A"};
-    ls::State stateB{"B"};
+    ls::std::logic::State stateA{"A"};
+    ls::std::logic::State stateB{"B"};
 
-    ASSERT_TRUE(stateA.addStateConnection(std::make_shared<ls::StateConnection>("AB", stateB.getId())));
+    ASSERT_TRUE(stateA.addStateConnection(std::make_shared<ls::std::logic::StateConnection>("AB", stateB.getId())));
   }
 
   TEST_F(StateTest, addStateConnection_v2_no_reference)
   {
-    ls::State stateA{"A"};
+    ls::std::logic::State stateA{"A"};
 
     EXPECT_THROW({
                    try
@@ -124,9 +124,9 @@ namespace
 
   TEST_F(StateTest, clearConnections)
   {
-    ls::State stateA{"A"};
-    stateA.addStateConnection(std::make_shared<ls::StateConnection>("AB", "B"));
-    stateA.addStateConnection(std::make_shared<ls::StateConnection>("AC", "C"));
+    ls::std::logic::State stateA{"A"};
+    stateA.addStateConnection(std::make_shared<ls::std::logic::StateConnection>("AB", "B"));
+    stateA.addStateConnection(std::make_shared<ls::std::logic::StateConnection>("AC", "C"));
 
     ASSERT_FALSE(stateA.getConnectedStates().empty());
     stateA.clearConnections();
@@ -135,19 +135,19 @@ namespace
 
   TEST_F(StateTest, getConnectedStates)
   {
-    ls::State stateA{"A"};
+    ls::std::logic::State stateA{"A"};
     ASSERT_TRUE(stateA.getConnectedStates().empty());
   }
 
   TEST_F(StateTest, getId)
   {
-    ls::State stateA{"A"};
+    ls::std::logic::State stateA{"A"};
     ASSERT_STREQ("A", stateA.getId().c_str());
   }
 
   TEST_F(StateTest, setId)
   {
-    ls::State stateA{"A"};
+    ls::std::logic::State stateA{"A"};
     ASSERT_STREQ("A", stateA.getId().c_str());
 
     stateA.setId("B");
@@ -156,7 +156,7 @@ namespace
 
   TEST_F(StateTest, setId_empty_id)
   {
-    ls::State stateA{"A"};
+    ls::std::logic::State stateA{"A"};
 
     EXPECT_THROW({
                    try
@@ -172,19 +172,19 @@ namespace
 
   TEST_F(StateTest, hasConnection)
   {
-    ls::State stateA{"A"};
-    ls::State stateB{"B"};
-    ls::State stateC{"C"};
+    ls::std::logic::State stateA{"A"};
+    ls::std::logic::State stateB{"B"};
+    ls::std::logic::State stateC{"C"};
 
-    ASSERT_TRUE(stateA.addStateConnection("AB", std::make_shared<ls::State>(stateB)));
+    ASSERT_TRUE(stateA.addStateConnection("AB", std::make_shared<ls::std::logic::State>(stateB)));
     ASSERT_TRUE(stateA.hasConnection("AB"));
-    ASSERT_TRUE(stateA.addStateConnection("AC", std::make_shared<ls::State>(stateC)));
+    ASSERT_TRUE(stateA.addStateConnection("AC", std::make_shared<ls::std::logic::State>(stateC)));
     ASSERT_TRUE(stateA.hasConnection("AC"));
   }
 
   TEST_F(StateTest, hasConnection_no_connections_available)
   {
-    ls::State stateA{"A"};
+    ls::std::logic::State stateA{"A"};
     ASSERT_FALSE(stateA.hasConnection("AB"));
   }
 }

+ 14 - 14
test/cases/logic/serialization/SerializableJsonStateConnectionTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -31,7 +31,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::SerializableJsonStateConnection serializable{nullptr};
+                     ls::std::logic::SerializableJsonStateConnection serializable{nullptr};
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -44,8 +44,8 @@ namespace
 
   TEST_F(SerializableJsonStateConnectionTest, marshal)
   {
-    ls::StateConnection x{"AB", "B"};
-    ls::SerializableJsonStateConnection serializable{std::make_shared<ls::StateConnection>(x)};
+    ls::std::logic::StateConnection x{"AB", "B"};
+    ls::std::logic::SerializableJsonStateConnection serializable{std::make_shared<ls::std::logic::StateConnection>(x)};
     ls::std::boxing::String jsonString{serializable.marshal()};
 
     ASSERT_STREQ(R"({"condition":false,"connectionId":"AB","stateId":"B"})", jsonString.toString().c_str());
@@ -53,12 +53,12 @@ namespace
 
   TEST_F(SerializableJsonStateConnectionTest, unmarshal)
   {
-    std::shared_ptr<ls::StateConnection> x = std::make_shared<ls::StateConnection>("AB", "B");
+    std::shared_ptr<ls::std::logic::StateConnection> x = std::make_shared<ls::std::logic::StateConnection>("AB", "B");
     ASSERT_STREQ("AB", x->getConnectionId().c_str());
     ASSERT_STREQ("B", x->getStateId().c_str());
     ASSERT_FALSE(x->isPassable());
 
-    ls::SerializableJsonStateConnection serializable{x};
+    ls::std::logic::SerializableJsonStateConnection serializable{x};
     serializable.unmarshal(R"({"condition":true,"connectionId":"BC","stateId":"C"})");
 
     ASSERT_STREQ("BC", x->getConnectionId().c_str());
@@ -68,23 +68,23 @@ namespace
 
   TEST_F(SerializableJsonStateConnectionTest, getValue)
   {
-    std::shared_ptr<ls::StateConnection> x = std::make_shared<ls::StateConnection>("AB", "B");
-    ls::SerializableJsonStateConnection serializable{x};
+    std::shared_ptr<ls::std::logic::StateConnection> x = std::make_shared<ls::std::logic::StateConnection>("AB", "B");
+    ls::std::logic::SerializableJsonStateConnection serializable{x};
     ASSERT_TRUE(serializable.getValue() == x);
   }
 
   TEST_F(SerializableJsonStateConnectionTest, setValue)
   {
-    ls::StateConnection x{"AB", "B"};
-    ls::SerializableJsonStateConnection serializable{std::make_shared<ls::StateConnection>(x)};
+    ls::std::logic::StateConnection x{"AB", "B"};
+    ls::std::logic::SerializableJsonStateConnection serializable{std::make_shared<ls::std::logic::StateConnection>(x)};
     ls::std::boxing::String jsonString{serializable.marshal()};
 
     ASSERT_STREQ(R"({"condition":false,"connectionId":"AB","stateId":"B"})", jsonString.toString().c_str());
 
     // set value should now reset json
 
-    ls::StateConnection y{"BC", "C"};
-    serializable.setValue(std::make_shared<ls::StateConnection>(y));
+    ls::std::logic::StateConnection y{"BC", "C"};
+    serializable.setValue(std::make_shared<ls::std::logic::StateConnection>(y));
     jsonString = serializable.marshal();
 
     ASSERT_STREQ(R"({"condition":false,"connectionId":"BC","stateId":"C"})", jsonString.toString().c_str());
@@ -92,8 +92,8 @@ namespace
 
   TEST_F(SerializableJsonStateConnectionTest, setValue_no_parameter_set)
   {
-    ls::StateConnection stateConnection{"AB", "B"};
-    ls::SerializableJsonStateConnection serializable{std::make_shared<ls::StateConnection>(stateConnection)};
+    ls::std::logic::StateConnection stateConnection{"AB", "B"};
+    ls::std::logic::SerializableJsonStateConnection serializable{std::make_shared<ls::std::logic::StateConnection>(stateConnection)};
 
     EXPECT_THROW({
                    try

+ 13 - 13
test/cases/logic/serialization/SerializableJsonStateMachineTest.cpp

@@ -33,7 +33,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::SerializableJsonStateMachine serializable{nullptr};
+                     ls::std::logic::SerializableJsonStateMachine serializable{nullptr};
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -46,10 +46,10 @@ namespace
 
   TEST_F(SerializableJsonStateMachineTest, marshal)
   {
-    ls::StateMachine stateMachine = ls_std_test::TestDataFactory::createStateMachine();
+    ls::std::logic::StateMachine stateMachine = ls_std_test::TestDataFactory::createStateMachine();
     stateMachine.setStartState("A");
     stateMachine.setMemory({"A", "B", "C"});
-    ls::SerializableJsonStateMachine serializable{std::make_shared<ls::StateMachine>(stateMachine)};
+    ls::std::logic::SerializableJsonStateMachine serializable{std::make_shared<ls::std::logic::StateMachine>(stateMachine)};
 
     std::string jsonString = serializable.marshal();
     ASSERT_TRUE(!jsonString.empty());
@@ -65,8 +65,8 @@ namespace
   {
     ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "/state_machine_test.json"};
     ls::std::io::FileReader reader{file};
-    std::shared_ptr<ls::StateMachine> machine = std::make_shared<ls::StateMachine>("bla");
-    ls::SerializableJsonStateMachine serializable{machine};
+    std::shared_ptr<ls::std::logic::StateMachine> machine = std::make_shared<ls::std::logic::StateMachine>("bla");
+    ls::std::logic::SerializableJsonStateMachine serializable{machine};
 
     serializable.unmarshal(reader.read());
 
@@ -90,7 +90,7 @@ namespace
     ASSERT_TRUE(!machine->getStates().empty());
     ASSERT_EQ(5, machine->getStates().size());
 
-    std::shared_ptr<ls::State> state = machine->getStates().at("A");
+    std::shared_ptr<ls::std::logic::State> state = machine->getStates().at("A");
     ASSERT_STREQ("A", state->getId().c_str());
     ASSERT_EQ(1, state->getConnectedStates().size());
     ASSERT_STREQ("AB", state->getConnectedStates().at("AB")->getConnectionId().c_str());
@@ -119,26 +119,26 @@ namespace
 
   TEST_F(SerializableJsonStateMachineTest, getValue)
   {
-    std::shared_ptr<ls::StateMachine> x = std::make_shared<ls::StateMachine>("bla");
-    ls::SerializableJsonStateMachine serializable{x};
+    std::shared_ptr<ls::std::logic::StateMachine> x = std::make_shared<ls::std::logic::StateMachine>("bla");
+    ls::std::logic::SerializableJsonStateMachine serializable{x};
     ASSERT_TRUE(serializable.getValue() == x);
   }
 
   TEST_F(SerializableJsonStateMachineTest, setValue)
   {
-    std::shared_ptr<ls::StateMachine> x = std::make_shared<ls::StateMachine>("bla");
-    ls::SerializableJsonStateMachine serializable{x};
+    std::shared_ptr<ls::std::logic::StateMachine> x = std::make_shared<ls::std::logic::StateMachine>("bla");
+    ls::std::logic::SerializableJsonStateMachine serializable{x};
     ASSERT_TRUE(serializable.getValue() == x);
 
-    x = std::make_shared<ls::StateMachine>("bla2");
+    x = std::make_shared<ls::std::logic::StateMachine>("bla2");
     serializable.setValue(x);
     ASSERT_TRUE(serializable.getValue() == x);
   }
 
   TEST_F(SerializableJsonStateMachineTest, setValue_no_parameter_set)
   {
-    std::shared_ptr<ls::StateMachine> stateMachine = std::make_shared<ls::StateMachine>("bla");
-    ls::SerializableJsonStateMachine serializable{stateMachine};
+    std::shared_ptr<ls::std::logic::StateMachine> stateMachine = std::make_shared<ls::std::logic::StateMachine>("bla");
+    ls::std::logic::SerializableJsonStateMachine serializable{stateMachine};
 
     EXPECT_THROW({
                    try

+ 17 - 17
test/cases/logic/serialization/SerializableJsonStateTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -31,7 +31,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::SerializableJsonState serializable{nullptr};
+                     ls::std::logic::SerializableJsonState serializable{nullptr};
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)
                    {
@@ -42,11 +42,11 @@ namespace
 
   TEST_F(SerializableJsonStateTest, marshal)
   {
-    std::shared_ptr<ls::State> x = std::make_shared<ls::State>("A");
-    x->addStateConnection(std::make_shared<ls::StateConnection>("AB", "B"));
-    x->addStateConnection(std::make_shared<ls::StateConnection>("AC", "C"));
+    std::shared_ptr<ls::std::logic::State> x = std::make_shared<ls::std::logic::State>("A");
+    x->addStateConnection(std::make_shared<ls::std::logic::StateConnection>("AB", "B"));
+    x->addStateConnection(std::make_shared<ls::std::logic::StateConnection>("AC", "C"));
 
-    ls::SerializableJsonState serializable{x};
+    ls::std::logic::SerializableJsonState serializable{x};
     ls::std::core::byte_field jsonString = serializable.marshal();
 
     ASSERT_TRUE(!jsonString.empty());
@@ -56,8 +56,8 @@ namespace
 
   TEST_F(SerializableJsonStateTest, unmarshal)
   {
-    std::shared_ptr<ls::State> x = std::make_shared<ls::State>("A");
-    ls::SerializableJsonState serializable{x};
+    std::shared_ptr<ls::std::logic::State> x = std::make_shared<ls::std::logic::State>("A");
+    ls::std::logic::SerializableJsonState serializable{x};
 
     // before
 
@@ -78,18 +78,18 @@ namespace
 
   TEST_F(SerializableJsonStateTest, getValue)
   {
-    std::shared_ptr<ls::State> x = std::make_shared<ls::State>("A");
-    ls::SerializableJsonState serializable{x};
+    std::shared_ptr<ls::std::logic::State> x = std::make_shared<ls::std::logic::State>("A");
+    ls::std::logic::SerializableJsonState serializable{x};
     ASSERT_TRUE(serializable.getValue() == x);
   }
 
   TEST_F(SerializableJsonStateTest, setValue)
   {
-    std::shared_ptr<ls::State> x = std::make_shared<ls::State>("A");
-    x->addStateConnection(std::make_shared<ls::StateConnection>("AB", "B"));
-    x->addStateConnection(std::make_shared<ls::StateConnection>("AC", "C"));
+    std::shared_ptr<ls::std::logic::State> x = std::make_shared<ls::std::logic::State>("A");
+    x->addStateConnection(std::make_shared<ls::std::logic::StateConnection>("AB", "B"));
+    x->addStateConnection(std::make_shared<ls::std::logic::StateConnection>("AC", "C"));
 
-    ls::SerializableJsonState serializable{x};
+    ls::std::logic::SerializableJsonState serializable{x};
     ls::std::core::byte_field jsonString = serializable.marshal();
 
     std::string expectedJson = R"({"connectedStates":{"AB":{"condition":false,"connectionId":"AB","stateId":"B"},"AC":{"condition":false,"connectionId":"AC","stateId":"C"}},"id":"A"})";
@@ -97,7 +97,7 @@ namespace
 
     // setValue should now clear json
 
-    std::shared_ptr<ls::State> y = std::make_shared<ls::State>("B");
+    std::shared_ptr<ls::std::logic::State> y = std::make_shared<ls::std::logic::State>("B");
     serializable.setValue(y);
     jsonString = serializable.marshal();
 
@@ -106,8 +106,8 @@ namespace
 
   TEST_F(SerializableJsonStateTest, setValue_parameter_not_set)
   {
-    std::shared_ptr<ls::State> state = std::make_shared<ls::State>("A");
-    ls::SerializableJsonState serializable{state};
+    std::shared_ptr<ls::std::logic::State> state = std::make_shared<ls::std::logic::State>("A");
+    ls::std::logic::SerializableJsonState serializable{state};
 
     EXPECT_THROW({
                    try

+ 2 - 2
test/classes/event/DailyNewsAgency.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -18,7 +18,7 @@
 
 namespace ls_std_test
 {
-  class DailyNewsAgency : public ls_std_test::NewsAgency, public ls::IListener
+  class DailyNewsAgency : public ls_std_test::NewsAgency, public ls::std::logic::IListener
   {
     public:
 

+ 2 - 2
test/classes/event/GossipNewsAgency.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -18,7 +18,7 @@
 
 namespace ls_std_test
 {
-  class GossipNewsAgency : public ls_std_test::NewsAgency, public ls::IListener
+  class GossipNewsAgency : public ls_std_test::NewsAgency, public ls::std::logic::IListener
   {
     public:
 

+ 2 - 2
test/classes/observer/TestDataMercedesCar.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2022-05-09
+ * Changed:         2022-05-11
  *
  * */
 
@@ -16,7 +16,7 @@
 
 namespace ls_std_test
 {
-  class TestDataMercedesCar : public TestDataCar, public ls::IListener
+  class TestDataMercedesCar : public TestDataCar, public ls::std::logic::IListener
   {
     public: