Skip to content

Commit

Permalink
Merge pull request #25 from SeadexGmbH/yasmine-1.4.2
Browse files Browse the repository at this point in the history
yasmine 1.4.2
  • Loading branch information
SeadexTM authored Oct 26, 2017
2 parents 4515d9a + b91be70 commit f75d566
Show file tree
Hide file tree
Showing 121 changed files with 9,388 additions and 45 deletions.
11 changes: 9 additions & 2 deletions CMakeHelpers/functionsRapidJSON.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ if(SX_RAPIDJSON)
else()
message("SX_RAPIDJSON is not set by user. Setting default value.")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(SX_RAPIDJSON "/usr/include/rapidjson")
find_package(RapidJSON)
if(NOT ("${RAPIDJSON_INCLUDE_DIRS}" STREQUAL ""))
set(SX_RAPIDJSON ${RAPIDJSON_INCLUDE_DIRS})
message(STATUS "Found rapidjson on: ${RAPIDJSON_INCLUDE_DIRS}")
else()
set(SX_RAPIDJSON /usr/include)
message(STATUS "Set default value for rapidjson")
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(SX_RAPIDJSON "C:\\Program Files\\rapidjson")
set(SX_RAPIDJSON "C:\\Program Files")
endif()
endif()

Expand Down
9 changes: 9 additions & 0 deletions libyasmine/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
All notable changes to this project are documented in this file.


##[1.3.2] - 2017-10-26

### Changed
� CMake: changes of RapidJSON include path handling

### Fixed
� bug: enqueuing of an event failed during the start of an async state machine


##[1.3.1] - 2017-10-16

### Added
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( 770 );
const sxe::uint16_t BUILD_NUMBER( 790 );


}
Expand Down
26 changes: 13 additions & 13 deletions libyasmine/source/async_state_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async_state_machine::async_state_machine( const std::string& _name,
run_and_event_mutex_(),
run_and_event_condition_(),
terminated_condition_(),
worker_thread_(),
worker_thread_(),
event_list_()
{
SX_LOG( hermes::log_level::LL_TRACE, "Creating async state_machine '%'.", _name );
Expand Down Expand Up @@ -66,6 +66,10 @@ bool async_state_machine::run()
{
SX_LOG( hermes::log_level::LL_INFO, "Starting async state machine '%'.", get_name() );

SX_ASSERT( ( state_machine_status::NEW == status_ ) || ( state_machine_status::STOPPED == status_ ),
"Status is neither 'NEW' nor 'STOPPED' on start!" );

status_ = state_machine_status::STARTED;
const bool state_machine_started = state_machine_base::run( this );
if( state_machine_started )
{
Expand All @@ -74,7 +78,7 @@ bool async_state_machine::run()
else
{
SX_LOG( hermes::log_level::LL_INFO, "Terminate pseudostate was reached in %.", get_name() );
status_ = state_machine_status::STOPPED;
status_ = state_machine_status::STOPPED;
}

SX_LOG( hermes::log_level::LL_INFO, "Started async state machine '%'.", get_name() );
Expand All @@ -84,7 +88,7 @@ bool async_state_machine::run()


void async_state_machine::halt_and_join()
{
{
SX_LOG( hermes::log_level::LL_INFO, "Stopping and joining async state machine '%'.", get_name() );

halt();
Expand Down Expand Up @@ -168,10 +172,6 @@ bool async_state_machine::push( const event_sptr& _event )

void async_state_machine::start_state_machine()
{
SX_ASSERT( ( state_machine_status::NEW == status_ ) || ( state_machine_status::STOPPED == status_ ),
"Status is neither 'NEW' nor 'STOPPED' on start!" );

status_ = state_machine_status::STARTED;
worker_thread_ = SX_MAKE_UNIQUE< sxe::thread >( &async_state_machine::work, this );
}

Expand Down Expand Up @@ -206,7 +206,7 @@ void async_state_machine::insert_impl( const event_sptr& _event )
{
if( event_list_.empty() )
{
event_list_.push_back( _event );
event_list_.push_back( _event );
}
else
if( event_list_.back()->get_priority() >= _event->get_priority() )
Expand All @@ -217,7 +217,7 @@ void async_state_machine::insert_impl( const event_sptr& _event )
{
std::list< event_sptr >::iterator position = event_list_.begin();
while( position != event_list_.end() )
{
{
if (_event->operator>(**position))
{
break;
Expand All @@ -232,7 +232,7 @@ void async_state_machine::insert_impl( const event_sptr& _event )

bool async_state_machine::wait_predicate() const
{
return( !( status_ == state_machine_status::STARTED ) || !event_list_.empty() );
return( !( status_ == state_machine_status::STARTED ) || !event_list_.empty() );
}


Expand All @@ -251,7 +251,7 @@ void async_state_machine::work()
event_sptr event;
{
sxe::unique_lock< sxe::mutex > lock( run_and_event_mutex_ );
run_and_event_condition_.wait( lock, sxe::bind( &async_state_machine::wait_predicate, this ) );
run_and_event_condition_.wait( lock, sxe::bind( &async_state_machine::wait_predicate, this ) );
if( !( status_ == state_machine_status::STARTED ) && ( event_list_.empty() || is_interrupted() ) )
{
break;
Expand All @@ -268,12 +268,12 @@ void async_state_machine::work()
}
catch ( const std::exception& exception )
{
SX_LOG( hermes::log_level::LL_FATAL, "Unhandled exception: '%'.", exception.what() );
SX_LOG( hermes::log_level::LL_FATAL, "Unhandled exception: '%'.", exception.what() );
status_ = state_machine_status::STOPPED;
}
catch ( ... )
{
SX_LOG( hermes::log_level::LL_FATAL, "Unknown exception!" );
SX_LOG( hermes::log_level::LL_FATAL, "Unknown exception!" );
status_ = state_machine_status::STOPPED;
}

Expand Down
2 changes: 1 addition & 1 deletion libyasmine/source/behavior_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace sxy
{


behavior_impl::behavior_impl( const behavior_function& _function )
behavior_impl::behavior_impl( const behavior_function& _function )
: function_( _function )
{
// Nothing to do...
Expand Down
2 changes: 1 addition & 1 deletion libyasmine/source/execution_state_do_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ execution_state_do_step::~execution_state_do_step() SX_NOEXCEPT


bool execution_state_do_step::execute_behavior( event_processing_callback* const _event_processing_callback,
const event& _event, events& _exception_events, async_event_handler* const _async_event_handler, event_collector& _event_collector ) const
const event& _event, events& _exception_events, async_event_handler* const _async_event_handler, event_collector& _event_collector ) const
{
SX_LOG( hermes::log_level::LL_TRACE, "Executing do behavior of state '%'.", state_.get_name() );
if( _event_processing_callback )
Expand Down
14 changes: 7 additions & 7 deletions libyasmine/source/region_pseudostate_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ region_pseudostate_impl::region_pseudostate_impl( const std::string& _name )
{
#ifdef Y_OPTIMIZE_4_SPEED
ancestors_.reserve( ANCESTORS_VECTOR_SIZE );
ancestors_as_regions_.reserve( ANCESTORS_VECTOR_SIZE );
#endif
ancestors_as_regions_.reserve( ANCESTORS_VECTOR_SIZE );
#endif
}


region_pseudostate_impl::~region_pseudostate_impl() SX_NOEXCEPT
{
// Nothing to do...
}


const state_machine_element* region_pseudostate_impl::get_parent() const
{
Expand Down Expand Up @@ -84,9 +84,9 @@ raw_composite_states region_pseudostate_impl::get_ancestors( composite_state* co

if( final_ancestor != ancestors_.end() )
{
raw_composite_states ancestors( ancestors_.begin(), final_ancestor + 1 );
raw_composite_states ancestors( ancestors_.begin(), final_ancestor + 1 );
if( !_include_final_ancestor )
{
{
ancestors.erase( std::remove( ancestors.begin(), ancestors.end(), _final_ancestor ), ancestors.end() );
}
return ( ancestors );
Expand All @@ -99,7 +99,7 @@ raw_composite_states region_pseudostate_impl::get_ancestors( composite_state* co
}
#else
raw_composite_states ancestors;
collect_ancestors( ancestors, _final_ancestor );
collect_ancestors( ancestors, _final_ancestor );
if( !_include_final_ancestor )
{
ancestors.erase( std::remove( ancestors.begin(), ancestors.end(), _final_ancestor ), ancestors.end() );
Expand All @@ -116,7 +116,7 @@ raw_regions region_pseudostate_impl::get_ancestors_as_regions() const
{
collect_ancestors_as_regions( ancestors_as_regions_ );
}
return ( ancestors_as_regions_ );
return ( ancestors_as_regions_ );
#else
raw_regions ancestor_regions;
collect_ancestors_as_regions( ancestor_regions );
Expand Down
2 changes: 1 addition & 1 deletion libyasmine/source/simple_state_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool simple_state_base::check( state_machine_defects& _defects ) const


bool simple_state_base::has_error_event() const
{
{
const bool state_has_error_event = !!error_event_;
return( state_has_error_event );
}
Expand Down
8 changes: 4 additions & 4 deletions libyasmine/source/simple_state_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@


namespace sxy
{
{


simple_state_impl::simple_state_impl( const std::string& _name, behavior_uptr _do_action, behavior_uptr _entry_action,
behavior_uptr _exit_action, const event_ids& _deferred_events, event_sptr _error_event )
: simple_state_base( _name, sxe::move( _entry_action ), sxe::move( _exit_action ), _deferred_events,
: simple_state_base( _name, sxe::move( _entry_action ), sxe::move( _exit_action ), _deferred_events,
_error_event ),
do_( sxe::move( _do_action ) )
do_( sxe::move( _do_action ) )
{
// Nothing to do...
}
Expand All @@ -39,7 +39,7 @@ simple_state_impl::~simple_state_impl() SX_NOEXCEPT
void simple_state_impl::execute_do_behavior( const event& _event, async_event_handler* const _async_event_handler,
event_collector& _event_collector ) const
{
SX_UNUSED_PARAMETER( _async_event_handler );
SX_UNUSED_PARAMETER( _async_event_handler );
const behavior* const behavior = get_do();
if( behavior )
{
Expand Down
5 changes: 3 additions & 2 deletions libyasmine/source/state_machine_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace sxy
}


#ifdef Y_PROFILER
#ifdef Y_PROFILER
sxe::uint32_t state_machine_base::get_number_of_processed_events() const
{
return( processed_events_ );
Expand Down Expand Up @@ -295,6 +295,7 @@ namespace sxy
return( state_machine_started );
}


bool state_machine_base::process_event( const event_sptr& _event, async_event_handler* const _async_event_handler )
{
#ifdef Y_PROFILER
Expand Down Expand Up @@ -341,7 +342,7 @@ namespace sxy
}
else
{
if( !event_was_unhandled ) //event_was_unhandled
if( !event_was_unhandled )
{
handle_unhandled_event( _event );
}
Expand Down
6 changes: 3 additions & 3 deletions libyasmine/source/transition_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool transition_executor::check_sort_and_execute_transitions( const compound_tra
transition_executor_impl_->conflict_check( _compound_transitions );
SX_LOG( hermes::log_level::LL_TRACE, "Sorting compound transitions." );
const raw_compound_transitions& sorted_compound_transitions =
transition_executor_impl_->sort_compound_transitions( _compound_transitions );
transition_executor_impl_->sort_compound_transitions( _compound_transitions );
SX_LOG( hermes::log_level::LL_TRACE, "Compound transitions sorted." );
SX_LOG( hermes::log_level::LL_TRACE, "Start calculating execution step(s) for all compound transitions." );

Expand All @@ -72,11 +72,11 @@ bool transition_executor::check_sort_and_execute_transitions( const compound_tra
raw_const_region_set entered_regions;
SX_LOG( hermes::log_level::LL_TRACE, "Calculate execution step(s) for one compound transition." );
transition_executor_impl_->find_states_to_enter_and_to_exit_and_calculate_execution_steps( *compound_transition,
execution_steps, entered_regions, _event, true, _event_collector );
execution_steps, entered_regions, _event, true, _event_collector );
SX_LOG( hermes::log_level::LL_TRACE, "Found % execution step(s).", execution_steps.size() );
SX_LOG( hermes::log_level::LL_TRACE, "Start running execution step(s)." );
terminate_pseudostate_has_been_reached = transition_executor_impl_->run_execution_steps( execution_steps,
_event_processing_callback, _event, _exception_events, _async_event_handler, _event_collector );
_event_processing_callback, _event, _exception_events, _async_event_handler, _event_collector );
SX_LOG( hermes::log_level::LL_TRACE, "Finished running execution step(s)." );
if( terminate_pseudostate_has_been_reached )
{
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( 770 );
const sxe::uint16_t BUILD_NUMBER( 790 );


}
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.4.2 released 2017-10-26
� libyasmine 1.3.2
� essentials 1.3.1
� hermes 1.1.2
� genesis 0.3.1
� yasmine_model 0.1.4
� libygen 0.1.2
� ygen 0.1.4


� yasmine 1.4.1 released 2017-10-16
� libyasmine 1.3.1
Expand Down
6 changes: 6 additions & 0 deletions yasmine_model/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All notable changes to this project are documented in this file.


##[0.1.4] - 2017-10-26

### Added
� rapidjson_document header as a wrapper for RapidJSON usage


##[0.1.3] - 2017-10-16

### Fixed
Expand Down
44 changes: 44 additions & 0 deletions yasmine_model/include/algorithm_parameters.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// This file is part of the Seadex yasmine ecosystem (http://yasmine.seadex.de). //
// Copyright (C) 2016-2017 Seadex GmbH //
// //
// Licensing information is available in the folder "license" which is part of this distribution. //
// The same information is available on the www @ http://yasmine.seadex.de/Licenses.html. //
// //
//////////////////////////////////////////////////////////////////////////////////////////////////////


#ifndef ALGORITHM_PARAMETERS_767C0EB2_9811_4764_8218_7F94032C29FD
#define ALGORITHM_PARAMETERS_767C0EB2_9811_4764_8218_7F94032C29FD


namespace sxy
{


extern const int TRANSITION_PRIORITIES_VECTOR_SIZE;
extern const int EXECUTION_STEPS_VECTOR_SIZE;
extern const int TRANSITION_STEPS_VECTOR_SIZE;
extern const int COMPOUND_TRANSITIONS_VECTOR_SIZE;
extern const int STATES_TO_EXIT_VECTOR_SIZE;
extern const int EXCEPTION_EVENTS_VECTOR_SIZE;
extern const int CHOICES_VECTOR_SIZE;
extern const int ENABLED_COMPOUND_TRANSITION_VECTOR_SIZE;
extern const int DEFERRED_EVENTS_VECTOR_SIZE;
extern const int DEFAULT_TRANSITIONS_OF_HISTORY_VECTORS_SIZE;
extern const int ENTRY_POINTS_VECTOR_SIZE;
extern const int EXIT_POINTS_VECTOR_SIZE;
extern const int PSEUDOSTETS_IN_REGION_VECTOR_SIZE;
extern const int ANCESTORS_VECTOR_SIZE;
extern const int ASCENDING_PATH_ANCESTORS_VECTOR_SIZE;
extern const int REGIONS_OF_FINAL_STATE;
extern const int REGIONS_OF_SIMPLE_STATE;
extern const int ANCESTORS_REGION_VECTOR_SIZE;
extern const int ACTIVE_STATE_CONFIGRATION_VECTOR_SIZE;


}


#endif
Loading

0 comments on commit f75d566

Please sign in to comment.