From 9f308a87f29a6583898100b8aab3388482ad652c Mon Sep 17 00:00:00 2001
From: Tibor Molnar <tm@seadex.de>
Date: Tue, 14 Aug 2018 16:41:13 +0200
Subject: [PATCH] yasmine 1.5.3

---
 examples/classic_farmroad/main.cpp                     |  8 ++++++--
 examples/event_collector_example/main.cpp              |  5 ++++-
 examples/hello_yasmine/hello_yasmine.cpp               |  5 ++++-
 .../unhandled_event_handler_example.cpp                |  5 ++++-
 libyasmine/changelog.txt                               |  7 +++++++
 libyasmine/include/async_behavior.hpp                  | 10 +++++-----
 libyasmine/include/yasmine.hpp                         |  1 +
 libyasmine/include_impl/build_number.hpp               |  2 +-
 libyasmine/source/async_behavior.cpp                   |  2 ++
 libyasmine/source/execution_state_do_step.cpp          |  2 ++
 libyasmine/source/execution_state_enter_step.cpp       |  2 ++
 libyasmine/source/execution_state_exit_step.cpp        |  2 ++
 libyasmine/source/region_impl.cpp                      |  8 +++++---
 libyasmine/source/simple_state_impl.cpp                |  2 ++
 libyasmine/source/timed_event_creator.cpp              | 10 +++++-----
 libyasmine/source/transition_controller.cpp            |  2 ++
 libyasmine/source/transition_executor.cpp              |  2 ++
 libyasmine/source/transition_executor_impl.cpp         |  2 ++
 libyasmine/source/transition_finder.cpp                |  2 ++
 libyasmine/source/transition_impl.cpp                  |  2 ++
 .../try_to_build_compound_transition_visitor.cpp       |  2 ++
 libyasmine/source/version.cpp                          |  2 +-
 libyasmine/source/vertex_impl.cpp                      |  2 ++
 libygen/include/libygen_build_number.hpp               |  2 +-
 version.txt                                            |  9 +++++++++
 yasmine_model/include/build_number.hpp                 |  2 +-
 ygen/include/ygen_build_number.hpp                     |  2 +-
 27 files changed, 79 insertions(+), 23 deletions(-)

diff --git a/examples/classic_farmroad/main.cpp b/examples/classic_farmroad/main.cpp
index cc49023..ac1903f 100644
--- a/examples/classic_farmroad/main.cpp
+++ b/examples/classic_farmroad/main.cpp
@@ -73,12 +73,14 @@ int main()
 #ifdef WIN32
 	sxy::utils::set_window_size( 250, 9999 );
 	sxy::utils::maximize_window();
-#endif	
+#endif
+#ifndef SX_NO_LOGGING
 	hermes::log_manager_template<hermes::std_timestamp_policy>& log_manager = hermes::log_manager::get_instance();
 	log_manager.set_log_level( hermes::log_level::LL_DEBUG );
 	log_manager.add_logger( SX_MAKE_UNIQUE< hermes::cout_logger >() );
 	log_manager.run();
 	sxy::version::log_version();
+#endif
 
 try
 {
@@ -106,7 +108,9 @@ catch ( ... )
 	error_code = 3;
 }
 
-log_manager.halt_and_join();
+#ifndef SX_NO_LOGGING
+	log_manager.halt_and_join();
+#endif
 
 	return( error_code );
 }
diff --git a/examples/event_collector_example/main.cpp b/examples/event_collector_example/main.cpp
index e969b3b..9260ec2 100644
--- a/examples/event_collector_example/main.cpp
+++ b/examples/event_collector_example/main.cpp
@@ -17,16 +17,19 @@
 int main()
 {
 	int error_code = 0;
-
+#ifndef SX_NO_LOGGING
 	hermes::log_manager_template<hermes::std_timestamp_policy>& log_manager = hermes::log_manager::get_instance();
 	log_manager.set_log_level( hermes::log_level::LL_ERROR );
 	log_manager.add_logger( SX_MAKE_UNIQUE< hermes::cout_logger >() );
 	log_manager.run();
 	sxy::version::log_version();
+#endif
 
 	examples::machine machine_example;
 
+#ifndef SX_NO_LOGGING
 	log_manager.halt_and_join();
+#endif
 
 	return( error_code );
 }
diff --git a/examples/hello_yasmine/hello_yasmine.cpp b/examples/hello_yasmine/hello_yasmine.cpp
index 0c2d9dc..f085eb9 100644
--- a/examples/hello_yasmine/hello_yasmine.cpp
+++ b/examples/hello_yasmine/hello_yasmine.cpp
@@ -63,12 +63,13 @@ bool check_state_machine_for_defects( const sxy::sync_state_machine& _state_mach
 int main()
 {
 	int error_code = 0;
-
+#ifndef SX_NO_LOGGING
 	hermes::log_manager_template<hermes::std_timestamp_policy>& log_manager = hermes::log_manager::get_instance();
 	log_manager.set_log_level( hermes::log_level::LL_FATAL );
 	log_manager.add_logger( SX_MAKE_UNIQUE< hermes::cout_logger >() );
 	log_manager.run();
 	sxy::version::log_version();
+#endif
 
 	const state_machine_uptr hello_yasmine_state_machine = setup_state_machine( "hello yasmine state machine" );
 	if( check_state_machine_for_defects( *hello_yasmine_state_machine ) )
@@ -97,7 +98,9 @@ int main()
 		error_code = 3;
 	}
 
+#ifndef SX_NO_LOGGING
 	log_manager.halt_and_join();
+#endif
 
 	return( error_code );
 }
diff --git a/examples/unhandled_event_handler_example/unhandled_event_handler_example.cpp b/examples/unhandled_event_handler_example/unhandled_event_handler_example.cpp
index 2027917..9dfa12a 100644
--- a/examples/unhandled_event_handler_example/unhandled_event_handler_example.cpp
+++ b/examples/unhandled_event_handler_example/unhandled_event_handler_example.cpp
@@ -57,11 +57,12 @@ bool check_state_machine_for_defects( const sxy::sync_state_machine& _state_mach
 int main()
 {
 	int error_code = 0;
-
+#ifndef SX_NO_LOGGING
 	hermes::log_manager_template<hermes::std_timestamp_policy>& log_manager = hermes::log_manager::get_instance();
 	log_manager.set_log_level( hermes::log_level::LL_FATAL );
 	log_manager.add_logger( SX_MAKE_UNIQUE< hermes::cout_logger >() );
 	log_manager.run();
+#endif
 
 	const state_machine_uptr ueh_state_machine = setup_state_machine( "Unhandled event handler state machine" );
 	if( check_state_machine_for_defects( *ueh_state_machine ) )
@@ -91,7 +92,9 @@ int main()
 		error_code = 3;
 	}
 
+#ifndef SX_NO_LOGGING
 	log_manager.halt_and_join();
+#endif
 
 	return( error_code );
 }
diff --git a/libyasmine/changelog.txt b/libyasmine/changelog.txt
index cccd52b..592eebd 100644
--- a/libyasmine/changelog.txt
+++ b/libyasmine/changelog.txt
@@ -1,6 +1,13 @@
 # Change log
 All notable changes to this project are documented in this file.
 
+##[1.3.7] - 2018-08-14
+
+### Fixed
+- added includes for the case when logging is disabled via SX_NO_LOGGING=NO
+- renamed Y_ASSERT to SX_ASSERT in region_impl.cpp
+- added essentials/base.hpp include in yasmine.hpp
+
 ##[1.3.6] - 2018-07-23
 
 ### Fixed
diff --git a/libyasmine/include/async_behavior.hpp b/libyasmine/include/async_behavior.hpp
index e9c6bd9..9139d9b 100644
--- a/libyasmine/include/async_behavior.hpp
+++ b/libyasmine/include/async_behavior.hpp
@@ -29,7 +29,7 @@ class async_event_handler;
 class event_collector;
 
 
-class async_behavior	
+class async_behavior
 {
 
 
@@ -39,18 +39,18 @@ class async_behavior
 	SX_NO_COPY(async_behavior)
 	void run( const event& _event, event_collector& _event_collector, const simple_state_base& _simple_state, async_event_handler& _async_event_handler );
 	void halt_and_join();
-											 
+
 protected:
 	bool should_stop() const;
-											
 
-private:		
+
+private:
 	void work( const event& _event, event_collector& _event_collector, const simple_state_base& _simple_state, 
 		async_event_handler& _async_event_handler );
 	virtual void run_impl( const event& _event, event_collector& _event_collector, 
 		async_event_handler& _async_event_handler ) = 0;
 	virtual void notify_should_stop();
-	void join();		
+	void join();
 
 	sxe::SX_UNIQUE_PTR<sxe::thread> worker_;
 	mutable sxe::mutex mutex_;
diff --git a/libyasmine/include/yasmine.hpp b/libyasmine/include/yasmine.hpp
index b4f3bba..d1785ca 100644
--- a/libyasmine/include/yasmine.hpp
+++ b/libyasmine/include/yasmine.hpp
@@ -18,6 +18,7 @@
 #include "essentials/compatibility/chrono.hpp"
 #include "essentials/compatibility/thread.hpp"
 #include "essentials/non_copyable.hpp"
+#include "essentials/base.hpp"
 
 #include "sync_state_machine.hpp"
 #include "async_state_machine.hpp"
diff --git a/libyasmine/include_impl/build_number.hpp b/libyasmine/include_impl/build_number.hpp
index 8033488..ac114bc 100644
--- a/libyasmine/include_impl/build_number.hpp
+++ b/libyasmine/include_impl/build_number.hpp
@@ -24,7 +24,7 @@ namespace version
 {
 
 
-const sxe::uint16_t BUILD_NUMBER( 870 );
+const sxe::uint16_t BUILD_NUMBER( 875 );
 
 
 }
diff --git a/libyasmine/source/async_behavior.cpp b/libyasmine/source/async_behavior.cpp
index 8a863d9..ca89aa5 100644
--- a/libyasmine/source/async_behavior.cpp
+++ b/libyasmine/source/async_behavior.cpp
@@ -11,6 +11,8 @@
 
 #include "async_behavior.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "behavior_exception.hpp"
diff --git a/libyasmine/source/execution_state_do_step.cpp b/libyasmine/source/execution_state_do_step.cpp
index 3b0ee1f..197fcf7 100644
--- a/libyasmine/source/execution_state_do_step.cpp
+++ b/libyasmine/source/execution_state_do_step.cpp
@@ -11,6 +11,8 @@
 
 #include "execution_state_do_step.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "state.hpp"
diff --git a/libyasmine/source/execution_state_enter_step.cpp b/libyasmine/source/execution_state_enter_step.cpp
index da53003..1e3f207 100644
--- a/libyasmine/source/execution_state_enter_step.cpp
+++ b/libyasmine/source/execution_state_enter_step.cpp
@@ -11,6 +11,8 @@
 
 #include "execution_state_enter_step.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "state.hpp"
diff --git a/libyasmine/source/execution_state_exit_step.cpp b/libyasmine/source/execution_state_exit_step.cpp
index e8c6975..3c306fc 100644
--- a/libyasmine/source/execution_state_exit_step.cpp
+++ b/libyasmine/source/execution_state_exit_step.cpp
@@ -11,6 +11,8 @@
 
 #include "execution_state_exit_step.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "state.hpp"
diff --git a/libyasmine/source/region_impl.cpp b/libyasmine/source/region_impl.cpp
index 64ed57a..386806d 100644
--- a/libyasmine/source/region_impl.cpp
+++ b/libyasmine/source/region_impl.cpp
@@ -11,9 +11,11 @@
 
 #include "region_impl.hpp"
 
+#include "essentials/base.hpp"
 #include "essentials/uri.hpp"
 
-#include "y_assert.hpp"
+#include "hermes/log.hpp"
+
 #include "state.hpp"
 #include "initial_pseudostate_impl.hpp"
 #include "choice_impl.hpp"
@@ -230,7 +232,7 @@ state* region_impl::get_last_active_state()
 
 initial_pseudostate& region_impl::add_initial_pseudostate( initial_pseudostate_uptr _initial_state )
 {
-	Y_ASSERT( !initial_pseudostate_, "There is already an initial pseudostate in the region." );
+	SX_ASSERT( !initial_pseudostate_, "There is already an initial pseudostate in the region." );
 	_initial_state->set_parent_region( this );
 	initial_pseudostate_ = _initial_state.get();
 	pseudostates_.push_back( sxe::move( _initial_state ) );
@@ -243,7 +245,7 @@ initial_pseudostate& region_impl::add_initial_pseudostate( initial_pseudostate_u
 
 initial_pseudostate& region_impl::add_initial_pseudostate( const std::string& _initial_pseudostate_name )
 {
-	Y_ASSERT( !initial_pseudostate_, "There is already an initial pseudostate in the region." );
+	SX_ASSERT( !initial_pseudostate_, "There is already an initial pseudostate in the region." );
 	sxe::SX_UNIQUE_PTR< sxy::initial_pseudostate_impl > initial_state =
 		SX_MAKE_UNIQUE< sxy::initial_pseudostate_impl >( _initial_pseudostate_name );
 	initial_state->set_parent_region( this );
diff --git a/libyasmine/source/simple_state_impl.cpp b/libyasmine/source/simple_state_impl.cpp
index ece8213..0bf7593 100644
--- a/libyasmine/source/simple_state_impl.cpp
+++ b/libyasmine/source/simple_state_impl.cpp
@@ -11,6 +11,8 @@
 
 #include "simple_state_impl.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "behavior.hpp"
diff --git a/libyasmine/source/timed_event_creator.cpp b/libyasmine/source/timed_event_creator.cpp
index 19a5b28..09b98ad 100644
--- a/libyasmine/source/timed_event_creator.cpp
+++ b/libyasmine/source/timed_event_creator.cpp
@@ -39,7 +39,7 @@ timed_event_creator::timed_event_creator( async_state_machine& _async_state_mach
 
 
 timed_event_creator::~timed_event_creator() SX_NOEXCEPT
-{		
+{
 	SX_ASSERT( !run_, "Thread is still running! It was not stopped." );
 	SX_ASSERT( !worker_, "The thread still exists!" );
 }
@@ -151,7 +151,7 @@ handle_type timed_event_creator::generate_handle()
 		if( maximum_handle_ == Y_INVALID_EVENT_CREATION_REQUEST_HANDLE )
 		{
 			maximum_handle_ = 0;
-		}			
+		}
 	}
 	while( check_if_handle_exists( handle ) );
 
@@ -185,14 +185,14 @@ void timed_event_creator::generate_event()
 			}
 			else
 			{
-				const event_creation_request& event_creation_request = *event_creation_requests_.begin();								
-				condition_variable_.wait_until( lock, event_creation_request.get_time() );								
+				const event_creation_request& event_creation_request = *event_creation_requests_.begin();
+				condition_variable_.wait_until( lock, event_creation_request.get_time() );
 				if( run_ )
 				{
 					event_queue::const_iterator event_iterator = event_creation_requests_.begin();
 					while( event_iterator != event_creation_requests_.end() )
 					{
-						const sxe::time_point< sxe::system_clock > now = sxe::system_clock::now();						
+						const sxe::time_point< sxe::system_clock > now = sxe::system_clock::now();
 						SX_LOG( hermes::log_level::LL_TRACE, "Checking for event @ %.", now.time_since_epoch().count() );
 						if( ( *event_iterator ).get_time() <= now )
 						{
diff --git a/libyasmine/source/transition_controller.cpp b/libyasmine/source/transition_controller.cpp
index ec2de77..58ecb77 100644
--- a/libyasmine/source/transition_controller.cpp
+++ b/libyasmine/source/transition_controller.cpp
@@ -12,6 +12,8 @@
 #include "transition_controller.hpp"
 
 #include "essentials/conversion.hpp"
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 #include "hermes/log_and_throw.hpp"
 
diff --git a/libyasmine/source/transition_executor.cpp b/libyasmine/source/transition_executor.cpp
index d27e45c..7407552 100644
--- a/libyasmine/source/transition_executor.cpp
+++ b/libyasmine/source/transition_executor.cpp
@@ -11,6 +11,8 @@
 
 #include "transition_executor.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "transition_executor_impl.hpp"
diff --git a/libyasmine/source/transition_executor_impl.cpp b/libyasmine/source/transition_executor_impl.cpp
index 36eac3e..04e4465 100644
--- a/libyasmine/source/transition_executor_impl.cpp
+++ b/libyasmine/source/transition_executor_impl.cpp
@@ -13,6 +13,8 @@
 
 #include <algorithm>
 
+#include "essentials/base.hpp"
+
 #include "hermes/log_and_throw.hpp"
 
 #include "state.hpp"
diff --git a/libyasmine/source/transition_finder.cpp b/libyasmine/source/transition_finder.cpp
index f4807c2..d07e9b4 100644
--- a/libyasmine/source/transition_finder.cpp
+++ b/libyasmine/source/transition_finder.cpp
@@ -11,6 +11,8 @@
 
 #include "transition_finder.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log_and_throw.hpp"
 
 #include "composite_state.hpp"
diff --git a/libyasmine/source/transition_impl.cpp b/libyasmine/source/transition_impl.cpp
index ca9e0ea..2ac2749 100644
--- a/libyasmine/source/transition_impl.cpp
+++ b/libyasmine/source/transition_impl.cpp
@@ -14,6 +14,8 @@
 #include <algorithm>
 
 #include "essentials/uri.hpp"
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "vertex.hpp"
diff --git a/libyasmine/source/try_to_build_compound_transition_visitor.cpp b/libyasmine/source/try_to_build_compound_transition_visitor.cpp
index 932af9a..71e0c2e 100644
--- a/libyasmine/source/try_to_build_compound_transition_visitor.cpp
+++ b/libyasmine/source/try_to_build_compound_transition_visitor.cpp
@@ -11,6 +11,8 @@
 
 #include "try_to_build_compound_transition_visitor.hpp"
 
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "join.hpp"
diff --git a/libyasmine/source/version.cpp b/libyasmine/source/version.cpp
index 8477750..4e76893 100644
--- a/libyasmine/source/version.cpp
+++ b/libyasmine/source/version.cpp
@@ -28,7 +28,7 @@ namespace
 
 const sxe::uint16_t VERSION_MAJOR( 1 );
 const sxe::uint16_t VERSION_MINOR( 3 );
-const sxe::uint16_t VERSION_PATCH( 6 );
+const sxe::uint16_t VERSION_PATCH( 7 );
 
 
 }
diff --git a/libyasmine/source/vertex_impl.cpp b/libyasmine/source/vertex_impl.cpp
index a4a16f4..f6d30af 100644
--- a/libyasmine/source/vertex_impl.cpp
+++ b/libyasmine/source/vertex_impl.cpp
@@ -15,6 +15,8 @@
 #include <iostream>
 
 #include "essentials/uri.hpp"
+#include "essentials/base.hpp"
+
 #include "hermes/log.hpp"
 
 #include "composite_state.hpp"
diff --git a/libygen/include/libygen_build_number.hpp b/libygen/include/libygen_build_number.hpp
index e6e903f..d339a45 100644
--- a/libygen/include/libygen_build_number.hpp
+++ b/libygen/include/libygen_build_number.hpp
@@ -24,7 +24,7 @@ namespace version
 {
 
 
-	const sxe::uint16_t BUILD_NUMBER( 850 );
+	const sxe::uint16_t BUILD_NUMBER( 875 );
 
 
 }
diff --git a/version.txt b/version.txt
index d7eb78f..0f4bf09 100644
--- a/version.txt
+++ b/version.txt
@@ -1,5 +1,14 @@
 Versions
 
+• yasmine 1.5.3 released 2018-08-14
+  • libyasmine 1.3.7
+  • essentials 1.3.2
+  • hermes 1.2.0
+  • genesis 0.3.2
+  • yasmine_model 0.2.1
+  • libygen 0.1.3
+  • ygen 0.1.5
+
 • yasmine 1.5.2 released 2018-07-23
   • libyasmine 1.3.6
   • essentials 1.3.2
diff --git a/yasmine_model/include/build_number.hpp b/yasmine_model/include/build_number.hpp
index 2b010cc..8a12053 100644
--- a/yasmine_model/include/build_number.hpp
+++ b/yasmine_model/include/build_number.hpp
@@ -24,7 +24,7 @@ namespace version
 {
 
 
-	const sxe::uint16_t BUILD_NUMBER( 870 );
+	const sxe::uint16_t BUILD_NUMBER( 875 );
 
 
 }
diff --git a/ygen/include/ygen_build_number.hpp b/ygen/include/ygen_build_number.hpp
index 25d3b28..158d56e 100644
--- a/ygen/include/ygen_build_number.hpp
+++ b/ygen/include/ygen_build_number.hpp
@@ -20,7 +20,7 @@ namespace version
 {
 
 
-	const sxe::uint16_t BUILD_NUMBER( 850 );
+	const sxe::uint16_t BUILD_NUMBER( 875 );
 
 
 }