5#include <softfloat.hpp>
7namespace sysio {
namespace chain {
9 template<
typename ...Indices>
12 template<
typename Index>
19 auto const& index = db.
get_index<Index>().indices();
20 const auto& first = index.begin();
21 const auto& last = index.end();
22 for (
auto itr = first; itr != last; ++itr) {
27 template<
typename Secondary,
typename Key,
typename F>
29 const auto& idx = db.
get_index<Index, Secondary>();
30 auto begin_itr = idx.lower_bound(begin_key);
31 auto end_itr = idx.lower_bound(end_key);
32 for (
auto itr = begin_itr; itr != end_itr; ++itr) {
37 template<
typename Secondary,
typename Key>
39 const auto& idx = db.
get_index<Index, Secondary>();
40 auto begin_itr = idx.lower_bound(begin_key);
41 auto end_itr = idx.lower_bound(end_key);
43 while (begin_itr != end_itr) {
51 db.
create<
typename index_t::value_type>(cons);
55 template<
typename Index>
68 template<
typename FirstIndex,
typename ...RemainingIndices>
83 template<
typename DataStream>
89 template<
typename DataStream>
99 template<
typename O
idType>
104 template<
typename O
idType>
147 memcpy(as_bytes, &
f,
sizeof(as_bytes));
148 std::string
s =
"0x";
149 s.append(
to_hex( as_bytes,
sizeof(as_bytes) ) );
157 memset(temp, 0,
sizeof(temp));
159 FC_ASSERT(
s.size() == 2 + 2 *
sizeof(temp) &&
s.find(
"0x") == 0,
"Failure in converting hex data into a float128_t");
160 auto sz =
from_hex(
s.substr(2), temp,
sizeof(temp) );
162 FC_ASSERT( sz ==
sizeof(temp),
"Failure in converting hex data into a float128_t" );
168 v =
variant(std::string(
s.begin(),
s.end()));
197 b.
data = std::vector<char>(_s.begin(), _s.end());
202 to_variant(std::vector<T>(sv.begin(), sv.end()), v);
215 template<
typename DataStream,
typename O
idType>
221 template<
typename DataStream,
typename O
idType>
229template<
typename DataStream>
237template<
typename DataStream>
245template<
typename DataStream>
253template<
typename DataStream>
const generic_index< MultiIndexType > & get_index() const
const ObjectType & create(Constructor &&con)
const allocator_type & get_allocator() const
const char * data() const
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
static void add_indices(chainbase::database &db)
static void walk_indices(F function)
static void add_indices(chainbase::database &db)
static void walk_indices(F function)
static void walk(const chainbase::database &db, F function)
static void create(chainbase::database &db, F cons)
static void walk_range(const chainbase::database &db, const Key &begin_key, const Key &end_key, F function)
static size_t size_range(const chainbase::database &db, const Key &begin_key, const Key &end_key)
DataStream & operator<<(DataStream &ds, const float64_t &v)
DataStream & operator>>(DataStream &ds, float64_t &v)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
DataStream & operator<<(DataStream &ds, const oid< OidType > &oid)
DataStream & operator>>(DataStream &ds, oid< OidType > &oid)
void unpack(Stream &s, std::deque< T > &value)
void pack(Stream &s, const std::deque< T > &value)
std::string base64_encode(unsigned char const *bytes_to_encode, unsigned int in_len)
void uint128_to_float128(const sysio::chain::uint128_t &u, float128_t &f)
void double_to_float64(const double &d, float64_t &f)
fc::string to_hex(const char *d, uint32_t s)
void float128_to_uint128(const float128_t &f, sysio::chain::uint128_t &u)
datastream< ST > & operator<<(datastream< ST > &s, const sysio::chain::may_not_exist< T > &v)
void from_variant(const fc::variant &v, sysio::chain::chain_id_type &cid)
void to_variant(const sysio::chain::shared_public_key &var, fc::variant &vo)
datastream< ST > & operator>>(datastream< ST > &s, sysio::chain::may_not_exist< T > &v)
std::string base64_decode(const std::string &encoded_string)
void float64_to_double(const float64_t &f, double &d)
unsigned __int128 uint128_t
boost::interprocess::vector< T, allocator< T > > shared_vector
chainbase::shared_string shared_string
memset(pInfo->slotDescription, ' ', 64)
memcpy((char *) pInfo->slotDescription, s, l)