I’ve recently read about the boost::statechart library (finite state machines) and I loved the concept.
Does C# have a similar mechanism ? Or can it be implemented using a specific design pattern?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, C# has iterator blocks which are compiler-generated state machines.
If you wish to implement you own state machine you can create custom implementations of the
IEnumerable<T>andIEnumerator<T>interfaces.Both of these approaches highlight the .NET framework’s implementation of the iterator pattern.