#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 + '`') {}
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") {}
};
-struct NoFutureInSplitter : FutureException {
+[[noreturn]] void throwPredicateDoesNotObtain();
+
+struct FOLLY_EXPORT NoFutureInSplitter : FutureException {
NoFutureInSplitter() : FutureException("No Future in this FutureSplitter") {}
};
+
+[[noreturn]] void throwNoFutureInSplitter();
}