Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::detail Namespace Reference

Classes

struct  actor_member
 
struct  actor_vtable_visitor
 
struct  add
 
struct  add_eq
 
class  any_api
 
class  appender_factory_impl
 
class  average_rate_meter
 
class  buffered_istream_impl
 
class  buffered_ostream_impl
 
class  callback_functor
 
class  callback_functor< void(Args...)>
 
struct  extract_op
 
class  gntp_icon_impl
 
class  gntp_notifier_impl
 
struct  insert_op
 
struct  is_operation_shorter
 
class  log_context_impl
 
class  log_message_impl
 
class  mmap_struct_base
 
class  ntp_impl
 
class  path_wrapper
 
class  pke_impl
 
class  rate_limited_operation
 
class  rate_limited_tcp_read_operation
 
class  rate_limited_tcp_write_operation
 
class  rate_limiting_group_impl
 
struct  sub
 
struct  sub_eq
 
struct  supports_allocator
 
class  url_impl
 

Typedefs

using unique_file = std::unique_ptr<FILE, decltype( &fclose )>
 

Functions

template<template< typename... > class Set, typename T , typename... U>
void to_variant_from_set (const Set< T, U... > &s, fc::variant &vo)
 
template<template< typename... > class Set, typename T , typename... U>
void from_variant_to_set (const fc::variant &v, Set< T, U... > &s)
 
template<template< typename... > class Set, typename T , typename... U>
void from_variant_to_flat_set (const fc::variant &v, Set< T, U... > &s)
 
template<template< typename... > class Map, typename K , typename V , typename... U>
void to_variant_from_map (const Map< K, V, U... > &m, fc::variant &vo)
 
template<template< typename... > class Map, typename K , typename V , typename... U>
void from_variant_to_map (const variant &v, Map< K, V, U... > &m)
 
template<template< typename... > class Map, typename K , typename V , typename... U>
void from_variant_to_flat_map (const variant &v, Map< K, V, U... > &m)
 
NO_RETURN void throw_datastream_range_error (const char *file, size_t len, int64_t over)
 
template<typename R , typename Arg0 , typename ... Args>
std::function< R(Args...)> bind_first_arg (const std::function< R(Arg0, Args...)> &f, Arg0 a0)
 
template<typename R >
R call_generic (const std::function< R()> &f, variants::const_iterator a0, variants::const_iterator e)
 
template<typename R , typename Arg0 , typename ... Args>
R call_generic (const std::function< R(Arg0, Args...)> &f, variants::const_iterator a0, variants::const_iterator e)
 
template<typename R , typename ... Args>
std::function< variant(const fc::variants &)> to_generic (const std::function< R(Args...)> &f)
 
template<typename ... Args>
std::function< variant(const fc::variants &)> to_generic (const std::function< void(Args...)> &f)
 
template<typename T >
fc::true_type is_class_helper (void(T::*)())
 
template<typename T , typename A , typename... Args>
auto construct_maybe_with_allocator (A &&allocator, Args &&... args) -> std::enable_if_t< supports_allocator< T, A >::value &&supports_allocator< T, A >::leading_allocator, T >
 
template<typename T , typename A , typename... Args>
auto maybe_augment_constructor_arguments_with_allocator (A &&allocator, std::tuple< Args &&... > args, std::enable_if_t< supports_allocator< T, A >::value &&supports_allocator< T, A >::leading_allocator, int >=0)
 
template<typename T , typename A , typename... Args>
auto maybe_augment_constructor_arguments_with_allocator (A &&allocator, std::tuple<>, std::enable_if_t< supports_allocator< T, A >::value &&supports_allocator< T, A >::leading_allocator, int >=0)
 
template<typename T , typename A , typename... Args>
auto maybe_augment_constructor_arguments_with_allocator (A &&allocator, std::tuple< Args &&... > args, std::enable_if_t< supports_allocator< T, A >::value &&!supports_allocator< T, A >::leading_allocator, int >=0)
 
template<typename T , typename A , typename... Args>
auto maybe_augment_constructor_arguments_with_allocator (A &&allocator, std::tuple<>, std::enable_if_t< supports_allocator< T, A >::value &&!supports_allocator< T, A >::leading_allocator, int >=0)
 
template<typename T , typename A , typename... Args>
auto maybe_augment_constructor_arguments_with_allocator (A &&, std::tuple< Args &&... > args, std::enable_if_t<!supports_allocator< T, A >::value, int >=0)
 
template<typename T1 , typename T2 , typename A >
std::pair< T1, T2 > default_construct_pair_maybe_with_allocator (A &&allocator)
 
void shift_l (const char *in, char *out, std::size_t n, unsigned int i)
 
void shift_r (const char *in, char *out, std::size_t n, unsigned int i)
 
boost::asio::ip::udp::endpoint to_asio_ep (const fc::ip::endpoint &e)
 

Variables

template<typename T >
fc::false_type is_class_helper (...)
 
bool have_so_reuseport = true
 

Typedef Documentation

◆ unique_file

using fc::detail::unique_file = std::unique_ptr<FILE, decltype( &fclose )>

Definition at line 22 of file cfile.hpp.

Function Documentation

◆ bind_first_arg()

template<typename R , typename Arg0 , typename ... Args>
std::function< R(Args...)> fc::detail::bind_first_arg ( const std::function< R(Arg0, Args...)> & f,
Arg0 a0 )

Definition at line 33 of file api_connection.hpp.

34 {
35 return [=]( Args... args ) { return f( a0, args... ); };
36 }
Here is the caller graph for this function:

◆ call_generic() [1/2]

template<typename R >
R fc::detail::call_generic ( const std::function< R()> & f,
variants::const_iterator a0,
variants::const_iterator e )

Definition at line 38 of file api_connection.hpp.

39 {
40 return f();
41 }
Here is the caller graph for this function:

◆ call_generic() [2/2]

template<typename R , typename Arg0 , typename ... Args>
R fc::detail::call_generic ( const std::function< R(Arg0, Args...)> & f,
variants::const_iterator a0,
variants::const_iterator e )

Definition at line 44 of file api_connection.hpp.

45 {
46 FC_ASSERT( a0 != e );
47 return call_generic<R,Args...>( bind_first_arg<R,Arg0,Args...>( f, a0->as< typename std::decay<Arg0>::type >() ), a0+1, e );
48 }
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
R call_generic(const std::function< R()> &f, variants::const_iterator a0, variants::const_iterator e)
std::function< R(Args...)> bind_first_arg(const std::function< R(Arg0, Args...)> &f, Arg0 a0)
#define R
Here is the call graph for this function:

◆ construct_maybe_with_allocator()

template<typename T , typename A , typename... Args>
auto fc::detail::construct_maybe_with_allocator ( A && allocator,
Args &&... args ) -> std::enable_if_t<supports_allocator<T, A>::value && supports_allocator<T, A>::leading_allocator, T>

Definition at line 60 of file utility.hpp.

62 {
63 return T( std::allocator_arg, std::forward<A>(allocator), std::forward<Args>(args)... );
64 }
#define T(meth, val, expected)
Here is the caller graph for this function:

◆ default_construct_pair_maybe_with_allocator()

template<typename T1 , typename T2 , typename A >
std::pair< T1, T2 > fc::detail::default_construct_pair_maybe_with_allocator ( A && allocator)

Definition at line 124 of file utility.hpp.

125 {
126 return std::pair<T1,T2>(
127 std::piecewise_construct,
128 maybe_augment_constructor_arguments_with_allocator<T1>( allocator, std::make_tuple() ),
129 maybe_augment_constructor_arguments_with_allocator<T2>( allocator, std::make_tuple() )
130 );
131 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_variant_to_flat_map()

template<template< typename... > class Map, typename K , typename V , typename... U>
void fc::detail::from_variant_to_flat_map ( const variant & v,
Map< K, V, U... > & m )

Definition at line 146 of file container_detail.hpp.

146 {
147 const variants& vars = v.get_array();
148 FC_ASSERT( vars.size() <= MAX_NUM_ARRAY_ELEMENTS );
149 m.clear();
150 m.reserve( vars.size() );
151 for( const auto& var : vars ) {
152 auto item = default_construct_pair_maybe_with_allocator<K, V>( m.get_allocator() );
153 var.as< std::pair<K,V> >( item );
154 m.insert( m.end(), std::move(item) );
155 }
156 }
variants & get_array()
Definition variant.cpp:496
std::vector< fc::variant > variants
Definition variant.hpp:173
#define MAX_NUM_ARRAY_ELEMENTS
Definition utility.hpp:18
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_variant_to_flat_set()

template<template< typename... > class Set, typename T , typename... U>
void fc::detail::from_variant_to_flat_set ( const fc::variant & v,
Set< T, U... > & s )

Definition at line 110 of file container_detail.hpp.

110 {
111 const variants& vars = v.get_array();
112 FC_ASSERT( vars.size() <= MAX_NUM_ARRAY_ELEMENTS );
113 s.clear();
114 s.reserve( vars.size() );
115 for( const auto& var : vars ) {
116 auto item = construct_maybe_with_allocator<T>( s.get_allocator() );
117 var.as<T>( item );
118 s.insert( s.end(), std::move(item) );
119 }
120 }
char * s
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_variant_to_map()

template<template< typename... > class Map, typename K , typename V , typename... U>
void fc::detail::from_variant_to_map ( const variant & v,
Map< K, V, U... > & m )

Definition at line 134 of file container_detail.hpp.

134 {
135 const variants& vars = v.get_array();
136 FC_ASSERT( vars.size() <= MAX_NUM_ARRAY_ELEMENTS );
137 m.clear();
138 for( const auto& var : vars ) {
139 auto item = default_construct_pair_maybe_with_allocator<K, V>( m.get_allocator() );
140 var.as< std::pair<K,V> >( item );
141 m.insert( m.end(), std::move(item) );
142 }
143 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_variant_to_set()

template<template< typename... > class Set, typename T , typename... U>
void fc::detail::from_variant_to_set ( const fc::variant & v,
Set< T, U... > & s )

Definition at line 98 of file container_detail.hpp.

98 {
99 const variants& vars = v.get_array();
100 FC_ASSERT( vars.size() <= MAX_NUM_ARRAY_ELEMENTS );
101 s.clear();
102 for( const auto& var : vars ) {
103 auto item = construct_maybe_with_allocator<T>( s.get_allocator() );
104 var.as<T>( item );
105 s.insert( s.end(), std::move(item) );
106 }
107 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_class_helper()

template<typename T >
fc::true_type fc::detail::is_class_helper ( void(T::*  )())

◆ maybe_augment_constructor_arguments_with_allocator() [1/5]

template<typename T , typename A , typename... Args>
auto fc::detail::maybe_augment_constructor_arguments_with_allocator ( A && ,
std::tuple< Args &&... > args,
std::enable_if_t<!supports_allocator< T, A >::value, int > = 0 )

Definition at line 116 of file utility.hpp.

119 {
120 return args;
121 }

◆ maybe_augment_constructor_arguments_with_allocator() [2/5]

template<typename T , typename A , typename... Args>
auto fc::detail::maybe_augment_constructor_arguments_with_allocator ( A && allocator,
std::tuple< Args &&... > args,
std::enable_if_t< supports_allocator< T, A >::value &&!supports_allocator< T, A >::leading_allocator, int > = 0 )

Definition at line 98 of file utility.hpp.

101 {
102 static_assert( supports_allocator<T, A>::trailing_allocator, "type supposedly supports allocators but cannot be constructed by either the leading- or trailing-allocator convention" );
103 return std::tuple_cat( args, std::forward_as_tuple<A>( allocator ) );
104 }

◆ maybe_augment_constructor_arguments_with_allocator() [3/5]

template<typename T , typename A , typename... Args>
auto fc::detail::maybe_augment_constructor_arguments_with_allocator ( A && allocator,
std::tuple< Args &&... > args,
std::enable_if_t< supports_allocator< T, A >::value &&supports_allocator< T, A >::leading_allocator, int > = 0 )

Definition at line 82 of file utility.hpp.

85 {
86 return std::tuple_cat( std::forward_as_tuple<std::allocator_arg_t, A>( std::allocator_arg, allocator ), args );
87 }
Here is the caller graph for this function:

◆ maybe_augment_constructor_arguments_with_allocator() [4/5]

template<typename T , typename A , typename... Args>
auto fc::detail::maybe_augment_constructor_arguments_with_allocator ( A && allocator,
std::tuple<> ,
std::enable_if_t< supports_allocator< T, A >::value &&!supports_allocator< T, A >::leading_allocator, int > = 0 )

Definition at line 107 of file utility.hpp.

110 {
111 static_assert( supports_allocator<T, A>::trailing_allocator, "type supposedly supports allocators but cannot be constructed by either the leading- or trailing-allocator convention" );
112 return std::forward_as_tuple<A>( allocator );
113 }

◆ maybe_augment_constructor_arguments_with_allocator() [5/5]

template<typename T , typename A , typename... Args>
auto fc::detail::maybe_augment_constructor_arguments_with_allocator ( A && allocator,
std::tuple<> ,
std::enable_if_t< supports_allocator< T, A >::value &&supports_allocator< T, A >::leading_allocator, int > = 0 )

Definition at line 90 of file utility.hpp.

93 {
94 return std::forward_as_tuple<std::allocator_arg_t, A>( std::allocator_arg, allocator );
95 }

◆ shift_l()

void fc::detail::shift_l ( const char * in,
char * out,
std::size_t n,
unsigned int i )

Definition at line 14 of file _digest_common.cpp.

14 {
15 const uint8_t* in8 = (uint8_t*) in;
16 uint8_t* out8 = (uint8_t*) out;
17
18 if (i >= 8) {
19 shift_l( in8, out8, n, i / 8 );
20 i &= 7;
21 in8 = out8;
22 }
23
24 std::size_t p;
25 for( p = 0; p < n-1; ++p )
26 out8[p] = (in8[p] << i) | (in8[p+1]>>(8-i));
27 out8[p] = in8[p] << i;
28 }
const mie::Vuint & p
Definition bn.cpp:27
unsigned char uint8_t
Definition stdint.h:124

◆ shift_r()

void fc::detail::shift_r ( const char * in,
char * out,
std::size_t n,
unsigned int i )

Definition at line 38 of file _digest_common.cpp.

38 {
39 const uint8_t* in8 = (uint8_t*) in;
40 uint8_t* out8 = (uint8_t*) out;
41
42 if (i >= 8) {
43 shift_r( in8, out8, n, i / 8 );
44 i &= 7;
45 in8 = out8;
46 }
47
48 std::size_t p;
49 for( p = n-1; p > 0; --p )
50 out8[p] = (in8[p] >> i) | (in8[p-1]<<(8-i));
51 out8[p] = in8[p] >> i;
52 }

◆ throw_datastream_range_error()

NO_RETURN void fc::detail::throw_datastream_range_error ( const char * file,
size_t len,
int64_t over )

Definition at line 4 of file datastream.cpp.

5{
6 FC_THROW_EXCEPTION( out_of_range_exception, "${method} datastream of length ${len} over by ${over}", ("method",fc::string(method))("len",len)("over",over) );
7}
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
std::string string
Definition string.hpp:10
size_t len
Here is the caller graph for this function:

◆ to_asio_ep()

boost::asio::ip::udp::endpoint fc::detail::to_asio_ep ( const fc::ip::endpoint & e)

Definition at line 23 of file gelf_appender.cpp.

24 {
25 return boost::asio::ip::udp::endpoint(boost::asio::ip::address_v4(e.get_address()), e.port() );
26 }
const address & get_address() const
Definition ip.cpp:72
uint16_t port() const
Definition ip.cpp:71
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_generic() [1/2]

template<typename R , typename ... Args>
std::function< variant(const fc::variants &)> fc::detail::to_generic ( const std::function< R(Args...)> & f)

Definition at line 51 of file api_connection.hpp.

52 {
53 return [=]( const variants& args ) {
54 return variant( call_generic( f, args.begin(), args.end() ) );
55 };
56 }
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_generic() [2/2]

template<typename ... Args>
std::function< variant(const fc::variants &)> fc::detail::to_generic ( const std::function< void(Args...)> & f)

Definition at line 59 of file api_connection.hpp.

60 {
61 return [=]( const variants& args ) {
62 call_generic( f, args.begin(), args.end() );
63 return variant();
64 };
65 }
Here is the call graph for this function:

◆ to_variant_from_map()

template<template< typename... > class Map, typename K , typename V , typename... U>
void fc::detail::to_variant_from_map ( const Map< K, V, U... > & m,
fc::variant & vo )

Definition at line 123 of file container_detail.hpp.

123 {
124 FC_ASSERT( m.size() <= MAX_NUM_ARRAY_ELEMENTS );
125 variants vars;
126 vars.reserve( m.size() );
127 for( const auto& item : m ) {
128 vars.emplace_back( item );
129 }
130 vo = std::move( vars );
131 }
Here is the caller graph for this function:

◆ to_variant_from_set()

template<template< typename... > class Set, typename T , typename... U>
void fc::detail::to_variant_from_set ( const Set< T, U... > & s,
fc::variant & vo )

Definition at line 87 of file container_detail.hpp.

87 {
89 variants vars;
90 vars.reserve( s.size() );
91 for( const auto& item : s ) {
92 vars.emplace_back( item );
93 }
94 vo = std::move( vars );
95 }
Here is the caller graph for this function:

Variable Documentation

◆ have_so_reuseport

bool fc::detail::have_so_reuseport = true

Definition at line 19 of file tcp_socket.cpp.

◆ is_class_helper

template<typename T >
fc::false_type fc::detail::is_class_helper(...) ( ...)