Skip to content

Commit

Permalink
yasmine 0.3.0
Browse files Browse the repository at this point in the history
Release of yasmine C++ finite state machine 0.3.0, September 2016
  • Loading branch information
SeadexTM committed Sep 19, 2016
1 parent 5ebf998 commit e6883be
Show file tree
Hide file tree
Showing 262 changed files with 2,872 additions and 2,346 deletions.
2 changes: 1 addition & 1 deletion yasmine/build/debug_info.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
</Link>
<ClCompile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
Expand Down
8 changes: 4 additions & 4 deletions yasmine/classic_farmroad/classic_farmroad.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,19 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="detector.h">
<ClInclude Include="detector.hpp">
<SubType>
</SubType>
</ClInclude>
<ClInclude Include="detector_callback.h">
<ClInclude Include="detector_callback.hpp">
<SubType>
</SubType>
</ClInclude>
<ClInclude Include="intersection.h">
<ClInclude Include="intersection.hpp">
<SubType>
</SubType>
</ClInclude>
<ClInclude Include="traffic_light.h">
<ClInclude Include="traffic_light.hpp">
<SubType>
</SubType>
</ClInclude>
Expand Down
8 changes: 4 additions & 4 deletions yasmine/classic_farmroad/classic_farmroad.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="detector_callback.h">
<ClInclude Include="detector.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="detector.h">
<ClInclude Include="detector_callback.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="intersection.h">
<ClInclude Include="intersection.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="traffic_light.h">
<ClInclude Include="traffic_light.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions yasmine/classic_farmroad/detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////


#include "detector.h"
#include "detector.hpp"

#include <thread>
#include <random>

#include "base.h"
#include "detector_callback.h"
#include "base.hpp"
#include "detector_callback.hpp"


namespace
Expand Down
57 changes: 57 additions & 0 deletions yasmine/classic_farmroad/detector.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// This file is part of the Seadex yasmine ecosystem (http://yasmine.seadex.de). //
// Copyright (C) 2016 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/License.html. //
// //
//////////////////////////////////////////////////////////////////////////////////////////////////////


#ifndef DETECTOR_5EBE86D2_647F_4029_94D8_B5521F641349
#define DETECTOR_5EBE86D2_647F_4029_94D8_B5521F641349


#include <memory>
#include <mutex>
#include <thread>
#include <condition_variable>


namespace sxy
{


class detector_callback;


class detector final
{
public:
explicit detector( detector_callback& _detector_callback );
~detector();
detector( const detector& ) = delete;
detector& operator=( const detector& ) = delete;
void start();
void stop();
bool is_on();


private:
void generate_detector_events();


detector_callback& detector_callback_;
bool is_on_;
std::unique_ptr< std::thread > generate_random_detector_events_;
bool run_;
std::mutex mutex_;
std::condition_variable condition_variable_;
};


}


#endif
35 changes: 35 additions & 0 deletions yasmine/classic_farmroad/detector_callback.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// This file is part of the Seadex yasmine ecosystem (http://yasmine.seadex.de). //
// Copyright (C) 2016 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/License.html. //
// //
//////////////////////////////////////////////////////////////////////////////////////////////////////


#ifndef DETECTOR_CALLBACK_0AF0AB58_4818_48B8_A10D_3894B6652355
#define DETECTOR_CALLBACK_0AF0AB58_4818_48B8_A10D_3894B6652355


namespace sxy
{


class detector_callback
{
public:
detector_callback() = default;
virtual ~detector_callback() = default;
detector_callback( const detector_callback& ) = delete;
detector_callback& operator=( const detector_callback& ) = delete;
virtual void detector_on() = 0;
virtual void detector_off() = 0;
};


}


#endif
Loading

0 comments on commit e6883be

Please sign in to comment.