Mark the base class of NoFutureInSplitter as public
[folly.git] / folly / futures / FutureException.h
index 57635424d84f9997ebbce5c6d7656f7b0bfe2e3c..4bd2021cec299e19e3540bbf58e6708c49f1cd5a 100644 (file)
 #include <stdexcept>
 #include <string>
 
+#include <folly/CPortability.h>
+
 namespace folly {
 
-class FutureException : public std::logic_error {
+class FOLLY_EXPORT FutureException : public std::logic_error {
  public:
   using std::logic_error::logic_error;
 };
 
-class BrokenPromise : public FutureException {
+class FOLLY_EXPORT BrokenPromise : public FutureException {
  public:
   explicit BrokenPromise(const std::string& type)
       : FutureException("Broken promise for type name `" + type + '`') {}
@@ -34,39 +36,69 @@ class BrokenPromise : public FutureException {
   explicit BrokenPromise(const char* type) : BrokenPromise(std::string(type)) {}
 };
 
-class NoState : public FutureException {
+class FOLLY_EXPORT NoState : public FutureException {
  public:
   NoState() : FutureException("No state") {}
 };
 
-class PromiseAlreadySatisfied : public FutureException {
+[[noreturn]] void throwNoState();
+
+class FOLLY_EXPORT PromiseAlreadySatisfied : public FutureException {
  public:
   PromiseAlreadySatisfied() : FutureException("Promise already satisfied") {}
 };
 
-class FutureNotReady : public FutureException {
+[[noreturn]] void throwPromiseAlreadySatisfied();
+
+class FOLLY_EXPORT FutureNotReady : public FutureException {
  public:
   FutureNotReady() : FutureException("Future not ready") {}
 };
 
-class FutureAlreadyRetrieved : public FutureException {
+[[noreturn]] void throwFutureNotReady();
+
+class FOLLY_EXPORT FutureAlreadyRetrieved : public FutureException {
  public:
   FutureAlreadyRetrieved() : FutureException("Future already retrieved") {}
 };
 
-class FutureCancellation : public FutureException {
+[[noreturn]] void throwFutureAlreadyRetrieved();
+
+class FOLLY_EXPORT FutureCancellation : public FutureException {
  public:
   FutureCancellation() : FutureException("Future was cancelled") {}
 };
 
-class TimedOut : public FutureException {
+class FOLLY_EXPORT TimedOut : public FutureException {
  public:
   TimedOut() : FutureException("Timed out") {}
 };
 
-class PredicateDoesNotObtain : public FutureException {
+[[noreturn]] void throwTimedOut();
+
+class FOLLY_EXPORT PredicateDoesNotObtain : public FutureException {
  public:
   PredicateDoesNotObtain() : FutureException("Predicate does not obtain") {}
 };
 
-}
+[[noreturn]] void throwPredicateDoesNotObtain();
+
+class FOLLY_EXPORT NoFutureInSplitter : public FutureException {
+ public:
+  NoFutureInSplitter() : FutureException("No Future in this FutureSplitter") {}
+};
+
+[[noreturn]] void throwNoFutureInSplitter();
+
+class FOLLY_EXPORT NoTimekeeper : public FutureException {
+ public:
+  NoTimekeeper() : FutureException("No timekeeper available") {}
+};
+
+[[noreturn]] void throwNoExecutor();
+
+class FOLLY_EXPORT NoExecutor : public FutureException {
+ public:
+  NoExecutor() : FutureException("No executor provided to via") {}
+};
+} // namespace folly