class EventBaseLocalBase : public EventBaseLocalBaseBase, boost::noncopyable {
public:
EventBaseLocalBase() {}
- virtual ~EventBaseLocalBase();
+ ~EventBaseLocalBase() override;
void erase(EventBase& evb);
void onEventBaseDestruction(EventBase& evb) override;
uint64_t key_{keyCounter_++};
};
-}
+} // namespace detail
/**
* A storage abstraction for data that should be tied to an EventBase.
* Foo& foo = myFoo.getOrCreateFn(evb, [] () { return new Foo(3, 4); })
*
* The objects will be deleted when the EventBaseLocal or the EventBase is
- * destructed (whichever comes first). All methods are thread-safe.
+ * destructed (whichever comes first). All methods must be called from the
+ * EventBase thread.
*
* The user is responsible for throwing away invalid references/ptrs returned
* by the get() method after set/erase is called. If shared ownership is
* needed, use a EventBaseLocal<shared_ptr<...>>.
*/
-template<typename T>
+template <typename T>
class EventBaseLocal : public detail::EventBaseLocalBase {
public:
EventBaseLocal(): EventBaseLocalBase() {}
}
};
-
-}
+} // namespace folly