Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
ClioNode.hpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of clio: https://github.com/XRPLF/clio
4 Copyright (c) 2025, the clio developers.
5
6 Permission to use, copy, modify, and 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#pragma once
21
22#include <boost/json/conversion.hpp>
23#include <boost/json/value.hpp>
24#include <boost/uuid/uuid.hpp>
25
26#include <chrono>
27#include <memory>
28
29namespace cluster {
30
34struct ClioNode {
38 static constexpr char const* kTIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ";
39
40 // enum class WriterRole {
41 // ReadOnly,
42 // NotWriter,
43 // Writer
44 // };
45
46 std::shared_ptr<boost::uuids::uuid> uuid;
47 std::chrono::system_clock::time_point updateTime;
48
49 // WriterRole writerRole;
50};
51
52void
53tag_invoke(boost::json::value_from_tag, boost::json::value& jv, ClioNode const& node);
54
56tag_invoke(boost::json::value_to_tag<ClioNode>, boost::json::value const& jv);
57
58} // namespace cluster
Represents a node in the cluster.
Definition ClioNode.hpp:34
std::shared_ptr< boost::uuids::uuid > uuid
The UUID of the node.
Definition ClioNode.hpp:46
std::chrono::system_clock::time_point updateTime
The time the data about the node was last updated.
Definition ClioNode.hpp:47
static constexpr char const * kTIME_FORMAT
The format of the time to store in the database.
Definition ClioNode.hpp:38