Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
chainbase Namespace Reference

Classes

class  abstract_index
 
class  abstract_session
 
class  chainbase_error_category
 
class  chainbase_node_allocator
 
class  database
 
struct  db_header
 
struct  environment
 
struct  get_index_type
 
struct  get_key
 
class  index
 
class  index_impl
 
struct  index_tag_impl
 
struct  index_tag_impl< Index< boost::multi_index::tag< Tag >, T... > >
 
class  int_incrementer
 
struct  mi_to_ui_ii
 
struct  mi_to_ui_ii< T, boost::mp11::mp_list< I... >, A >
 
struct  multi_index_to_undo_index_impl
 
struct  multi_index_to_undo_index_impl< boost::multi_index_container< T, I, A > >
 
struct  object
 
struct  offset_node_base
 
struct  offset_node_traits
 
struct  offset_node_value_traits
 
class  oid
 
class  pinnable_mapped_file
 
class  read_write_mutex_manager
 
struct  scope_exit
 
class  session_impl
 
struct  set_impl
 
class  shared_cow_string
 
struct  to_mp11
 
class  undo_index
 
struct  value_holder
 

Typedefs

template<typename T >
using allocator = bip::allocator<T, pinnable_mapped_file::segment_manager>
 
template<typename T >
using node_allocator = chainbase_node_allocator<T, pinnable_mapped_file::segment_manager>
 
using shared_string = shared_cow_string
 
typedef boost::interprocess::interprocess_sharable_mutex read_write_mutex
 
typedef boost::interprocess::sharable_lock< read_write_mutexread_lock
 
template<typename MultiIndexType >
using generic_index = multi_index_to_undo_index<MultiIndexType>
 
template<typename Object , typename... Args>
using shared_multi_index_container = boost::multi_index_container<Object,Args..., chainbase::node_allocator<Object> >
 
template<typename Allocator , typename T >
using rebind_alloc_t = typename std::allocator_traits<Allocator>::template rebind_alloc<T>
 
template<typename Index >
using index_tag = typename index_tag_impl<Index>::type
 
template<typename Tag , typename... Indices>
using find_tag = boost::mp11::mp_find<boost::mp11::mp_list<index_tag<Indices>...>, Tag>
 
template<typename K , typename Allocator >
using hook = offset_node_base<K>
 
template<typename Node , typename OrderedIndex >
using set_base
 
template<typename Node , typename Tag >
using list_base
 
template<typename MultiIndexContainer >
using multi_index_to_undo_index = typename multi_index_to_undo_index_impl<MultiIndexContainer>::type
 

Enumerations

enum  db_error_code {
  ok = 0 , dirty , incompatible , incorrect_db_version ,
  not_found , bad_size , unsupported_win32_mode , bad_header ,
  no_access , aborted , no_mlock
}
 

Functions

template<typename DataStream , typename OidType >
DataStream & operator<< (DataStream &ds, const oid< OidType > &oid)
 
template<typename DataStream , typename OidType >
DataStream & operator>> (DataStream &ds, oid< OidType > &oid)
 
template<typename DataStream >
DataStream & operator<< (DataStream &s, const chainbase::shared_cow_string &v)
 
template<typename DataStream >
DataStream & operator>> (DataStream &s, chainbase::shared_cow_string &v)
 
struct chainbase::environment __attribute__ ((packed))
 
std::ostream & operator<< (std::ostream &os, const chainbase::environment &dt)
 
const std::error_category & chainbase_error_category ()
 
std::error_code make_error_code (db_error_code e) noexcept
 
std::istream & operator>> (std::istream &in, pinnable_mapped_file::map_mode &runtime)
 
std::ostream & operator<< (std::ostream &osm, pinnable_mapped_file::map_mode m)
 
template<typename L , typename It , typename Pred , typename Disposer >
void remove_if_after_and_dispose (L &l, It it, It end, Pred &&p, Disposer &&d)
 
template<template< typename > class A, typename T >
auto & propagate_allocator (A< T > &a)
 
template<typename T , typename S >
auto & propagate_allocator (boost::interprocess::allocator< T, S > &a)
 
template<typename T , typename S , std::size_t N>
auto propagate_allocator (boost::interprocess::node_allocator< T, S, N > &a)
 
template<typename T , typename S , std::size_t N>
auto propagate_allocator (boost::interprocess::private_node_allocator< T, S, N > &a)
 
template<typename T , typename S >
auto propagate_allocator (chainbase::chainbase_node_allocator< T, S > &a)
 

Variables

constexpr size_t header_size = 1024
 
constexpr uint64_t header_id = 0x3242444f49534f45ULL
 
constexpr size_t header_dirty_bit_offset = offsetof(db_header, dirty)
 
template<typename OrderedIndex >
constexpr bool is_valid_index = false
 

Typedef Documentation

◆ allocator

template<typename T >
using chainbase::allocator = bip::allocator<T, pinnable_mapped_file::segment_manager>

Definition at line 56 of file chainbase.hpp.

◆ find_tag

template<typename Tag , typename... Indices>
using chainbase::find_tag = boost::mp11::mp_find<boost::mp11::mp_list<index_tag<Indices>...>, Tag>

Definition at line 150 of file undo_index.hpp.

◆ generic_index

template<typename MultiIndexType >
using chainbase::generic_index = multi_index_to_undo_index<MultiIndexType>

Definition at line 136 of file chainbase.hpp.

◆ hook

template<typename K , typename Allocator >
using chainbase::hook = offset_node_base<K>

Definition at line 153 of file undo_index.hpp.

◆ index_tag

template<typename Index >
using chainbase::index_tag = typename index_tag_impl<Index>::type

Definition at line 147 of file undo_index.hpp.

◆ list_base

template<typename Node , typename Tag >
using chainbase::list_base
Initial value:
boost::intrusive::slist<
typename Node::value_type,
boost::intrusive::value_traits<offset_node_value_traits<Node, Tag>>>

Definition at line 168 of file undo_index.hpp.

◆ multi_index_to_undo_index

template<typename MultiIndexContainer >
using chainbase::multi_index_to_undo_index = typename multi_index_to_undo_index_impl<MultiIndexContainer>::type

Definition at line 929 of file undo_index.hpp.

◆ node_allocator

◆ read_lock

typedef boost::interprocess::sharable_lock< read_write_mutex > chainbase::read_lock

Definition at line 64 of file chainbase.hpp.

◆ read_write_mutex

typedef boost::interprocess::interprocess_sharable_mutex chainbase::read_write_mutex

Definition at line 63 of file chainbase.hpp.

◆ rebind_alloc_t

template<typename Allocator , typename T >
using chainbase::rebind_alloc_t = typename std::allocator_traits<Allocator>::template rebind_alloc<T>

Definition at line 140 of file undo_index.hpp.

◆ set_base

template<typename Node , typename OrderedIndex >
using chainbase::set_base
Initial value:
boost::intrusive::avltree<
typename Node::value_type,
boost::intrusive::value_traits<offset_node_value_traits<Node, OrderedIndex>>,
boost::intrusive::key_of_value<get_key<typename OrderedIndex::key_from_value_type, typename Node::value_type>>,
boost::intrusive::compare<typename OrderedIndex::compare_type>>

Definition at line 156 of file undo_index.hpp.

◆ shared_multi_index_container

template<typename Object , typename... Args>
using chainbase::shared_multi_index_container = boost::multi_index_container<Object,Args..., chainbase::node_allocator<Object> >

Definition at line 558 of file chainbase.hpp.

◆ shared_string

Definition at line 61 of file chainbase.hpp.

Enumeration Type Documentation

◆ db_error_code

Enumerator
ok 
dirty 
incompatible 
incorrect_db_version 
not_found 
bad_size 
unsupported_win32_mode 
bad_header 
no_access 
aborted 
no_mlock 

Definition at line 14 of file pinnable_mapped_file.hpp.

Function Documentation

◆ __attribute__()

struct chainbase::db_header chainbase::__attribute__ ( (packed) )

◆ chainbase_error_category()

const std::error_category & chainbase::chainbase_error_category ( )

Definition at line 48 of file pinnable_mapped_file.cpp.

48 {
49 static class chainbase_error_category the_category;
50 return the_category;
51}
Here is the caller graph for this function:

◆ make_error_code()

std::error_code chainbase::make_error_code ( db_error_code e)
inlinenoexcept

Definition at line 30 of file pinnable_mapped_file.hpp.

30 {
31 return std::error_code(static_cast<int>(e), chainbase_error_category());
32}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<() [1/4]

template<typename DataStream , typename OidType >
DataStream & chainbase::operator<< ( DataStream & ds,
const oid< OidType > & oid )

Definition at line 216 of file database_utils.hpp.

216 {
217 fc::raw::pack(ds, oid._id);
218 return ds;
219 }
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
Here is the call graph for this function:

◆ operator<<() [2/4]

template<typename DataStream >
DataStream & chainbase::operator<< ( DataStream & s,
const chainbase::shared_cow_string & v )
inline

Definition at line 392 of file types.hpp.

392 {
395 if( v.size() ) s.write( v.data(), v.size() );
396 return s;
397 }
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
unsigned int uint32_t
Definition stdint.h:126
#define MAX_SIZE_OF_BYTE_ARRAYS
Definition utility.hpp:19
char * s
Here is the call graph for this function:

◆ operator<<() [3/4]

std::ostream & chainbase::operator<< ( std::ostream & os,
const chainbase::environment & dt )

Definition at line 377 of file pinnable_mapped_file.cpp.

377 {
378 os << std::right << std::setw(17) << "Compiler: " << dt.compiler << std::endl;
379 os << std::right << std::setw(17) << "Debug: " << (dt.debug ? "Yes" : "No") << std::endl;
380 os << std::right << std::setw(17) << "OS: " << print_os(dt.os) << std::endl;
381 os << std::right << std::setw(17) << "Arch: " << print_arch(dt.arch) << std::endl;
382 os << std::right << std::setw(17) << "Boost: " << dt.boost_version/100000 << "."
383 << dt.boost_version/100%1000 << "."
384 << dt.boost_version%100 << std::endl;
385 return os;
386}
os_t os

◆ operator<<() [4/4]

std::ostream & chainbase::operator<< ( std::ostream & osm,
pinnable_mapped_file::map_mode m )

Definition at line 347 of file pinnable_mapped_file.cpp.

347 {
348 if(m == pinnable_mapped_file::map_mode::mapped)
349 osm << "mapped";
350 else if (m == pinnable_mapped_file::map_mode::heap)
351 osm << "heap";
352 else if (m == pinnable_mapped_file::map_mode::locked)
353 osm << "locked";
354
355 return osm;
356}

◆ operator>>() [1/3]

template<typename DataStream , typename OidType >
DataStream & chainbase::operator>> ( DataStream & ds,
oid< OidType > & oid )

Definition at line 222 of file database_utils.hpp.

222 {
224 return ds;
225 }
void unpack(Stream &s, std::deque< T > &value)
Definition raw.hpp:540
Here is the call graph for this function:

◆ operator>>() [2/3]

template<typename DataStream >
DataStream & chainbase::operator>> ( DataStream & s,
chainbase::shared_cow_string & v )
inline

Definition at line 399 of file types.hpp.

399 {
400 fc::unsigned_int size; fc::raw::unpack( s, size );
402 FC_ASSERT( v.size() == 0 );
403 v.resize_and_fill(size.value, [&s](char* buf, std::size_t sz) { s.read(buf, sz); });
404 return s;
405 }
void resize_and_fill(std::size_t new_size, F &&f)
uint32_t value
Definition varint.hpp:17
uint8_t buf[2048]
Here is the call graph for this function:

◆ operator>>() [3/3]

std::istream & chainbase::operator>> ( std::istream & in,
pinnable_mapped_file::map_mode & runtime )

Definition at line 333 of file pinnable_mapped_file.cpp.

333 {
334 std::string s;
335 in >> s;
336 if (s == "mapped")
337 runtime = pinnable_mapped_file::map_mode::mapped;
338 else if (s == "heap")
339 runtime = pinnable_mapped_file::map_mode::heap;
340 else if (s == "locked")
341 runtime = pinnable_mapped_file::map_mode::locked;
342 else
343 in.setstate(std::ios_base::failbit);
344 return in;
345}

◆ propagate_allocator() [1/5]

template<template< typename > class A, typename T >
auto & chainbase::propagate_allocator ( A< T > & a)

Definition at line 222 of file undo_index.hpp.

222{ return a; }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
Here is the caller graph for this function:

◆ propagate_allocator() [2/5]

template<typename T , typename S >
auto & chainbase::propagate_allocator ( boost::interprocess::allocator< T, S > & a)

Definition at line 224 of file undo_index.hpp.

224{ return a; }

◆ propagate_allocator() [3/5]

template<typename T , typename S , std::size_t N>
auto chainbase::propagate_allocator ( boost::interprocess::node_allocator< T, S, N > & a)

Definition at line 226 of file undo_index.hpp.

226{ return boost::interprocess::allocator<T, S>{a.get_segment_manager()}; }

◆ propagate_allocator() [4/5]

template<typename T , typename S , std::size_t N>
auto chainbase::propagate_allocator ( boost::interprocess::private_node_allocator< T, S, N > & a)

Definition at line 228 of file undo_index.hpp.

228{ return boost::interprocess::allocator<T, S>{a.get_segment_manager()}; }

◆ propagate_allocator() [5/5]

template<typename T , typename S >
auto chainbase::propagate_allocator ( chainbase::chainbase_node_allocator< T, S > & a)

Definition at line 230 of file undo_index.hpp.

230{ return boost::interprocess::allocator<T, S>{a.get_segment_manager()}; }

◆ remove_if_after_and_dispose()

template<typename L , typename It , typename Pred , typename Disposer >
void chainbase::remove_if_after_and_dispose ( L & l,
It it,
It end,
Pred && p,
Disposer && d )

Definition at line 173 of file undo_index.hpp.

173 {
174 for(;;) {
175 It next = it;
176 ++next;
177 if(next == end) break;
178 if(p(*next)) { l.erase_after_and_dispose(it, d); }
179 else { it = next; }
180 }
181 }
const mie::Vuint & p
Definition bn.cpp:27
int l

Variable Documentation

◆ header_dirty_bit_offset

size_t chainbase::header_dirty_bit_offset = offsetof(db_header, dirty)
constexpr

Definition at line 73 of file environment.hpp.

◆ header_id

uint64_t chainbase::header_id = 0x3242444f49534f45ULL
constexpr

Definition at line 8 of file environment.hpp.

◆ header_size

size_t chainbase::header_size = 1024
constexpr

Definition at line 7 of file environment.hpp.

◆ is_valid_index

template<typename OrderedIndex >
bool chainbase::is_valid_index< boost::multi_index::ordered_unique< T... > > = false
constexpr

Definition at line 163 of file undo_index.hpp.