20#ifndef RIPPLE_SHAMAP_SHAMAPITEM_H_INCLUDED 
   21#define RIPPLE_SHAMAP_SHAMAPITEM_H_INCLUDED 
   23#include <xrpl/basics/ByteUtilities.h> 
   24#include <xrpl/basics/CountedObject.h> 
   25#include <xrpl/basics/SlabAllocator.h> 
   26#include <xrpl/basics/Slice.h> 
   27#include <xrpl/basics/base_uint.h> 
   28#include <xrpl/beast/utility/instrumentation.h> 
   30#include <boost/smart_ptr/intrusive_ptr.hpp> 
   47    friend boost::intrusive_ptr<SHAMapItem>
 
  102        return reinterpret_cast<std::uint8_t const*
>(
this) + 
sizeof(*
this);
 
 
 
  137        LogicError(
"SHAMapItem: the reference count is 0!");
 
 
  160inline boost::intrusive_ptr<SHAMapItem>
 
  164        data.size() <= megabytes<std::size_t>(16),
 
  165        "ripple::make_shamapitem : maximum input size");
 
  178    return {
new (raw) 
SHAMapItem{tag, data}, 
false};
 
 
  184inline boost::intrusive_ptr<SHAMapItem>
 
Tracks the number of instances of an object.
 
SHAMapItem(SHAMapItem &&other)=delete
 
void const * data() const
 
friend void intrusive_ptr_add_ref(SHAMapItem const *x)
 
uint256 const & key() const
 
std::uint32_t const size_
 
SHAMapItem(uint256 const &tag, Slice data)
 
friend void intrusive_ptr_release(SHAMapItem const *x)
 
SHAMapItem & operator=(SHAMapItem const &other)=delete
 
friend boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
 
std::atomic< std::uint32_t > refcount_
 
SHAMapItem & operator=(SHAMapItem &&)=delete
 
SHAMapItem(SHAMapItem const &other)=delete
 
A collection of slab allocators of various sizes for a given type.
 
An immutable linear range of bytes.
 
SlabAllocatorSet< SHAMapItem > slabber({ { 128, megabytes(std::size_t(60)) }, { 192, megabytes(std::size_t(46)) }, { 272, megabytes(std::size_t(60)) }, { 384, megabytes(std::size_t(56)) }, { 564, megabytes(std::size_t(40)) }, { 772, megabytes(std::size_t(46)) }, { 1052, megabytes(std::size_t(60)) }, })
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
constexpr auto megabytes(T value) noexcept
 
void intrusive_ptr_release(SHAMapItem const *x)
 
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
 
void intrusive_ptr_add_ref(SHAMapItem const *x)
 
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.