rippled
Loading...
Searching...
No Matches
State.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2021 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 RIPPLE_APP_RDB_STATE_H_INCLUDED
21#define RIPPLE_APP_RDB_STATE_H_INCLUDED
22
23#include <xrpld/app/ledger/Ledger.h>
24#include <xrpld/app/misc/Manifest.h>
25#include <xrpld/core/Config.h>
26#include <xrpld/core/DatabaseCon.h>
27#include <xrpld/peerfinder/detail/Store.h>
28
29#include <boost/filesystem.hpp>
30
31namespace ripple {
32
39
46void
48 soci::session& session,
49 BasicConfig const& config,
50 std::string const& dbName);
51
58getCanDelete(soci::session& session);
59
67setCanDelete(soci::session& session, LedgerIndex canDelete);
68
76getSavedState(soci::session& session);
77
85void
86setSavedState(soci::session& session, SavedState const& state);
87
93void
94setLastRotated(soci::session& session, LedgerIndex seq);
95
96} // namespace ripple
97
98#endif
Holds unparsed configuration information.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
LedgerIndex getCanDelete(soci::session &session)
getCanDelete Returns the ledger sequence which can be deleted.
Definition State.cpp:81
SavedState getSavedState(soci::session &session)
getSavedState Returns the saved state.
Definition State.cpp:99
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition State.cpp:111
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition State.cpp:25
LedgerIndex setCanDelete(soci::session &session, LedgerIndex canDelete)
setCanDelete Updates the ledger sequence which can be deleted.
Definition State.cpp:91
void setLastRotated(soci::session &session, LedgerIndex seq)
setLastRotated Updates the last rotated ledger sequence.
Definition State.cpp:123
LedgerIndex lastRotated
Definition State.h:37
std::string writableDb
Definition State.h:35
std::string archiveDb
Definition State.h:36