Skip to Content
Design Patterns in Modern C++20: Reusable Approaches for Object-Oriented Software Design
book

Design Patterns in Modern C++20: Reusable Approaches for Object-Oriented Software Design

by Dmitri Nesteruk
November 2021
Beginner to intermediate
391 pages
5h 23m
English
Apress
Content preview from Design Patterns in Modern C++20: Reusable Approaches for Object-Oriented Software Design
© Dmitri Nesteruk 2022
D. NesterukDesign Patterns in Modern C++20https://doi.org/10.1007/978-1-4842-7295-4_21

21. State

Dmitri Nesteruk1  
(1)
St. Petersburg, Russia
 

I must confess: my behavior is governed by my state. If I didn’t get enough sleep, I’m going to be a bit tired. If I had a drink, I wouldn’t get behind the wheel. All of these are states and they govern my behavior: how I feel, what I can and cannot do.

I can, of course, transition from one state to another. I can go get a coffee, and this will take me from sleepy to alert (I hope!). So we can think of coffee as a trigger that causes a transition of yours truly from sleepy to just about awake. Here, let me clumsily illustrate it for you:1
        coffee
sleepy --------> alert

So, the State ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Design Patterns in Modern C++: Reusable Approaches for Object-Oriented Software Design

Design Patterns in Modern C++: Reusable Approaches for Object-Oriented Software Design

Dmitri Nesteruk

Publisher Resources

ISBN: 9781484272954Purchase LinkPublisher Website