Skip to content

Commit

Permalink
Merge pull request #34 from SeadexGmbH/yasmine-1.5.3
Browse files Browse the repository at this point in the history
yasmine 1.5.3
  • Loading branch information
SeadexTM authored Aug 14, 2018
2 parents c037350 + 9f308a8 commit fd54269
Show file tree
Hide file tree
Showing 27 changed files with 79 additions and 23 deletions.
8 changes: 6 additions & 2 deletions examples/classic_farmroad/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 );
}
5 changes: 4 additions & 1 deletion examples/event_collector_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
5 changes: 4 additions & 1 deletion examples/hello_yasmine/hello_yasmine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
Expand Down Expand Up @@ -97,7 +98,9 @@ int main()
error_code = 3;
}

#ifndef SX_NO_LOGGING
log_manager.halt_and_join();
#endif

return( error_code );
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
Expand Down Expand Up @@ -91,7 +92,9 @@ int main()
error_code = 3;
}

#ifndef SX_NO_LOGGING
log_manager.halt_and_join();
#endif

return( error_code );
}
7 changes: 7 additions & 0 deletions libyasmine/changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions libyasmine/include/async_behavior.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class async_event_handler;
class event_collector;


class async_behavior
class async_behavior
{


Expand All @@ -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_;
Expand Down
1 change: 1 addition & 0 deletions libyasmine/include/yasmine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion libyasmine/include_impl/build_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace version
{


const sxe::uint16_t BUILD_NUMBER( 870 );
const sxe::uint16_t BUILD_NUMBER( 875 );


}
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/async_behavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "async_behavior.hpp"

#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "behavior_exception.hpp"
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/execution_state_do_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "execution_state_do_step.hpp"

#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "state.hpp"
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/execution_state_enter_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "execution_state_enter_step.hpp"

#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "state.hpp"
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/execution_state_exit_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "execution_state_exit_step.hpp"

#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "state.hpp"
Expand Down
8 changes: 5 additions & 3 deletions libyasmine/source/region_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ) );
Expand All @@ -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 );
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/simple_state_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "simple_state_impl.hpp"

#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "behavior.hpp"
Expand Down
10 changes: 5 additions & 5 deletions libyasmine/source/timed_event_creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!" );
}
Expand Down Expand Up @@ -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 ) );

Expand Down Expand Up @@ -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 )
{
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/transition_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/transition_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "transition_executor.hpp"

#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "transition_executor_impl.hpp"
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/transition_executor_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include <algorithm>

#include "essentials/base.hpp"

#include "hermes/log_and_throw.hpp"

#include "state.hpp"
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/transition_finder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "transition_finder.hpp"

#include "essentials/base.hpp"

#include "hermes/log_and_throw.hpp"

#include "composite_state.hpp"
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/transition_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <algorithm>

#include "essentials/uri.hpp"
#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "vertex.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "try_to_build_compound_transition_visitor.hpp"

#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "join.hpp"
Expand Down
2 changes: 1 addition & 1 deletion libyasmine/source/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );


}
Expand Down
2 changes: 2 additions & 0 deletions libyasmine/source/vertex_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <iostream>

#include "essentials/uri.hpp"
#include "essentials/base.hpp"

#include "hermes/log.hpp"

#include "composite_state.hpp"
Expand Down
2 changes: 1 addition & 1 deletion libygen/include/libygen_build_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace version
{


const sxe::uint16_t BUILD_NUMBER( 850 );
const sxe::uint16_t BUILD_NUMBER( 875 );


}
Expand Down
9 changes: 9 additions & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion yasmine_model/include/build_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace version
{


const sxe::uint16_t BUILD_NUMBER( 870 );
const sxe::uint16_t BUILD_NUMBER( 875 );


}
Expand Down
2 changes: 1 addition & 1 deletion ygen/include/ygen_build_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace version
{


const sxe::uint16_t BUILD_NUMBER( 850 );
const sxe::uint16_t BUILD_NUMBER( 875 );


}
Expand Down

0 comments on commit fd54269

Please sign in to comment.