Commit 3a757e76 authored by Dominik Charousset's avatar Dominik Charousset

Apply coding conventions to fixed_stack example

parent 75f8b39d
...@@ -42,21 +42,7 @@ The following example illustrates a more advanced state-based actor that impleme ...@@ -42,21 +42,7 @@ The following example illustrates a more advanced state-based actor that impleme
\clearpage \clearpage
\begin{lstlisting} \begin{lstlisting}
class fixed_stack : public sb_actor<fixed_stack> { class fixed_stack : public sb_actor<fixed_stack> {
friend class sb_actor<fixed_stack>;
size_t max_size;
vector<int> data;
behavior full;
behavior filled;
behavior empty;
behavior& init_state = empty;
public: public:
fixed_stack(size_t max) : max_size(max) { fixed_stack(size_t max) : max_size(max) {
assert(max_size > 0); assert(max_size > 0);
full = ( full = (
...@@ -91,9 +77,14 @@ class fixed_stack : public sb_actor<fixed_stack> { ...@@ -91,9 +77,14 @@ class fixed_stack : public sb_actor<fixed_stack> {
return atom("failure"); return atom("failure");
} }
); );
} }
private:
size_t max_size;
vector<int> data;
behavior full;
behavior filled;
behavior empty;
behavior& init_state = empty;
}; };
\end{lstlisting} \end{lstlisting}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment