1 /*************************************************************************
6 * [2011] - [2012] Realm Inc
9 * NOTICE: All information contained herein is, and remains
10 * the property of Realm Incorporated and its suppliers,
11 * if any. The intellectual and technical concepts contained
12 * herein are proprietary to Realm Incorporated
13 * and its suppliers and may be covered by U.S. and Foreign Patents,
14 * patents in process, and are protected by trade secret or copyright law.
15 * Dissemination of this information or reproduction of this material
16 * is strictly forbidden unless prior written permission is obtained
17 * from Realm Incorporated.
19 **************************************************************************/
20 #ifndef REALM_SYNC_FEATURE_TOKEN_HPP
21 #define REALM_SYNC_FEATURE_TOKEN_HPP
23 #include <realm/util/features.h>
25 #if !REALM_MOBILE && !defined(REALM_EXCLUDE_FEATURE_TOKENS)
26 #define REALM_HAVE_FEATURE_TOKENS 1
28 #define REALM_HAVE_FEATURE_TOKENS 0
31 #if REALM_HAVE_FEATURE_TOKENS
35 #include <realm/string_data.hpp>
43 // The constructor takes a JWT token as argument.
44 // The constructor throws a std::runtime_error if
45 // the token is invalid. An invalid token is a token
46 // that has bad syntax, is not signed by Realm, or is
48 FeatureGate(StringData token);
50 // Constructs a feature gate without any features.
54 FeatureGate(FeatureGate&&);
55 FeatureGate& operator=(FeatureGate&&);
57 bool has_feature(StringData feature_name);
61 std::unique_ptr<Impl> m_impl;
68 #endif // REALM_HAVE_FEATURE_TOKENS
69 #endif // REALM_SYNC_FEATURE_TOKEN_HPP