rippled
Loading...
Searching...
No Matches
Version.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLED_RIPPLE_RPC_HANDLERS_VERSION_H
21#define RIPPLED_RIPPLE_RPC_HANDLERS_VERSION_H
22
23#include <xrpld/rpc/detail/RPCHelpers.h>
24
25namespace ripple {
26namespace RPC {
27
29{
30public:
32 : apiVersion_(c.apiVersion), betaEnabled_(c.app.config().BETA_RPC_API)
33 {
34 }
35
36 Status
38 {
39 return Status::OK;
40 }
41
42 template <class Object>
43 void
44 writeResult(Object& obj)
45 {
47 }
48
49 static constexpr char const* name = "version";
50
51 static constexpr unsigned minApiVer = RPC::apiMinimumSupportedVersion;
52
53 static constexpr unsigned maxApiVer = RPC::apiMaximumValidVersion;
54
55 static constexpr Role role = Role::USER;
56
57 static constexpr Condition condition = NO_CONDITION;
58
59private:
60 unsigned int apiVersion_;
62};
63
64} // namespace RPC
65} // namespace ripple
66
67#endif
void writeResult(Object &obj)
Definition Version.h:44
static constexpr unsigned maxApiVer
Definition Version.h:53
static constexpr Role role
Definition Version.h:55
unsigned int apiVersion_
Definition Version.h:60
static constexpr Condition condition
Definition Version.h:57
static constexpr char const * name
Definition Version.h:49
static constexpr unsigned minApiVer
Definition Version.h:51
VersionHandler(JsonContext &c)
Definition Version.h:31
@ NO_CONDITION
Definition Handler.h:39
static constexpr std::integral_constant< unsigned, Version > apiVersion
Definition ApiVersion.h:53
static constexpr auto apiMaximumValidVersion
Definition ApiVersion.h:62
void setVersion(Object &parent, unsigned int apiVersion, bool betaEnabled)
Definition RPCHelpers.h:213
static constexpr auto apiMinimumSupportedVersion
Definition ApiVersion.h:56
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
Role
Indicates the level of administrative permission to grant.
Definition Role.h:44
Status represents the results of an operation that might fail.
Definition Status.h:40
static constexpr Code OK
Definition Status.h:46