/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// For best results, use an "enum class" for Enum.
template <class Enum>
class FSM {
-private:
+ private:
// I am not templatizing this because folly::MicroSpinLock needs to be
// zero-initialized (or call init) which isn't generic enough for something
// that behaves like std::mutex. :(
// An optimization would be to use a static conditional on the Enum type.
std::atomic<Enum> state_;
-public:
+ public:
explicit FSM(Enum startState) : state_(startState) {}
Enum getState() const noexcept {