TARAXA
taraxa::util Namespace Reference

Namespaces

 event
 
 lazy
 

Classes

struct  DefaultConstructCopyableMovable
 
struct  RLPDecoderRef
 
struct  InvalidEncodingSize
 
class  EncodingSolidity
 
class  ThreadPool
 

Typedefs

using RLPEncoderRef = dev::RLPStream &
 
using task_t = std::function< void()>
 
using task_executor_t = std::function< void(task_t &&)>
 

Functions

template<typename... Params>
void rlp_tuple (RLPEncoderRef encoding, Params const &... args)
 
template<typename T >
auto rlp (RLPEncoderRef encoding, T const &target) -> decltype(RLP().toInt< T >(), void())
 
template<unsigned N>
void rlp (RLPEncoderRef encoding, dev::FixedHash< N > const &target)
 
auto rlp (RLPEncoderRef encoding, std::string const &target)
 
auto rlp (RLPEncoderRef encoding, dev::bytes const &target)
 
template<typename Param >
void rlp (RLPEncoderRef encoding, std::optional< Param > const &target)
 
template<typename Param >
void rlp (RLPEncoderRef encoding, std::shared_ptr< Param > const &target)
 
template<typename T1 , typename T2 >
void rlp (RLPEncoderRef encoding, std::pair< T1, T2 > const &target)
 
template<typename Sequence >
auto rlp (RLPEncoderRef encoding, Sequence const &target) -> decltype(target.size(), target.begin(), target.end(), void())
 
template<typename Param , typename... Params>
void __enc_rlp_tuple_body__ (RLPEncoderRef encoding, Param const &target, Params const &... rest)
 
template<typename... Params>
void rlp_tuple (RLPDecoderRef encoding, Params &... args)
 
template<typename T >
auto rlp (RLPDecoderRef encoding, T &target) -> decltype(encoding.value.toInt< T >(), void())
 
template<unsigned N>
void rlp (RLPDecoderRef encoding, dev::FixedHash< N > &target)
 
auto rlp (RLPDecoderRef encoding, std::string &target)
 
auto rlp (RLPDecoderRef encoding, dev::bytes &target)
 
template<typename Param >
void rlp (RLPDecoderRef encoding, std::optional< Param > &target)
 
template<typename Param >
void rlp (RLPDecoderRef encoding, std::shared_ptr< Param > &target)
 
template<typename Sequence >
auto rlp (RLPDecoderRef encoding, Sequence &target) -> decltype(target.emplace_back(), void())
 
void rlp (RLPDecoderRef encoding, bool &target)
 
template<typename Map >
auto rlp (RLPDecoderRef encoding, Map &target) -> decltype(target[target.begin() ->first], void())
 
template<typename Param , typename... Params>
void __dec_rlp_tuple_body__ (RLP::iterator &i, RLP::iterator const &end, RLP::Strictness strictness, Param &target, Params &... rest)
 
template<typename T >
rlp_dec (RLPDecoderRef encoding)
 
template<typename T >
dev::bytes const & rlp_enc (RLPEncoderRef encoder_to_reuse, T const &obj)
 
template<typename T >
dev::bytes rlp_enc (T const &obj)
 
task_executor_t current_thread_executor ()
 
Json::Value parse_json (std::string_view const &str)
 
std::string to_string (Json::Value const &json, bool no_indent=true)
 
void writeJsonToFile (const std::string &file_name, const Json::Value &json)
 
Json::Value readJsonFromFile (const std::string &file_name)
 
Json::Value readJsonFromString (std::string_view str)
 
Json::Value readJsonFromFile (const std::filesystem::path &file_path)
 

Typedef Documentation

◆ RLPEncoderRef

◆ task_executor_t

using taraxa::util::task_executor_t = typedef std::function<void(task_t &&)>

◆ task_t

using taraxa::util::task_t = typedef std::function<void()>

Function Documentation

◆ __dec_rlp_tuple_body__()

template<typename Param , typename... Params>
void taraxa::util::__dec_rlp_tuple_body__ ( RLP::iterator i,
RLP::iterator const &  end,
RLP::Strictness  strictness,
Param &  target,
Params &...  rest 
)

◆ __enc_rlp_tuple_body__()

template<typename Param , typename... Params>
void taraxa::util::__enc_rlp_tuple_body__ ( RLPEncoderRef  encoding,
Param const &  target,
Params const &...  rest 
)

◆ current_thread_executor()

task_executor_t taraxa::util::current_thread_executor ( )
inline

◆ parse_json()

Json::Value taraxa::util::parse_json ( std::string_view const &  str)

◆ readJsonFromFile() [1/2]

Json::Value taraxa::util::readJsonFromFile ( const std::filesystem::path &  file_path)

◆ readJsonFromFile() [2/2]

Json::Value taraxa::util::readJsonFromFile ( const std::string &  file_name)

◆ readJsonFromString()

Json::Value taraxa::util::readJsonFromString ( std::string_view  str)

◆ rlp() [1/17]

void taraxa::util::rlp ( RLPDecoderRef  encoding,
bool &  target 
)
inline

◆ rlp() [2/17]

auto taraxa::util::rlp ( RLPDecoderRef  encoding,
dev::bytes target 
)
inline

◆ rlp() [3/17]

template<unsigned N>
void taraxa::util::rlp ( RLPDecoderRef  encoding,
dev::FixedHash< N > &  target 
)

◆ rlp() [4/17]

template<typename Map >
auto taraxa::util::rlp ( RLPDecoderRef  encoding,
Map &  target 
) -> decltype(target[target.begin()->first], void())

◆ rlp() [5/17]

template<typename Sequence >
auto taraxa::util::rlp ( RLPDecoderRef  encoding,
Sequence &  target 
) -> decltype(target.emplace_back(), void())

◆ rlp() [6/17]

template<typename Param >
void taraxa::util::rlp ( RLPDecoderRef  encoding,
std::optional< Param > &  target 
)

◆ rlp() [7/17]

template<typename Param >
void taraxa::util::rlp ( RLPDecoderRef  encoding,
std::shared_ptr< Param > &  target 
)

◆ rlp() [8/17]

auto taraxa::util::rlp ( RLPDecoderRef  encoding,
std::string &  target 
)
inline

◆ rlp() [9/17]

template<typename T >
auto taraxa::util::rlp ( RLPDecoderRef  encoding,
T &  target 
) -> decltype(encoding.value.toInt<T>(), void())
inline

◆ rlp() [10/17]

auto taraxa::util::rlp ( RLPEncoderRef  encoding,
dev::bytes const &  target 
)
inline

◆ rlp() [11/17]

template<unsigned N>
void taraxa::util::rlp ( RLPEncoderRef  encoding,
dev::FixedHash< N > const &  target 
)

◆ rlp() [12/17]

template<typename Sequence >
auto taraxa::util::rlp ( RLPEncoderRef  encoding,
Sequence const &  target 
) -> decltype(target.size(), target.begin(), target.end(), void())

◆ rlp() [13/17]

template<typename Param >
void taraxa::util::rlp ( RLPEncoderRef  encoding,
std::optional< Param > const &  target 
)

◆ rlp() [14/17]

template<typename T1 , typename T2 >
void taraxa::util::rlp ( RLPEncoderRef  encoding,
std::pair< T1, T2 > const &  target 
)

◆ rlp() [15/17]

template<typename Param >
void taraxa::util::rlp ( RLPEncoderRef  encoding,
std::shared_ptr< Param > const &  target 
)

◆ rlp() [16/17]

auto taraxa::util::rlp ( RLPEncoderRef  encoding,
std::string const &  target 
)
inline

◆ rlp() [17/17]

template<typename T >
auto taraxa::util::rlp ( RLPEncoderRef  encoding,
T const &  target 
) -> decltype(RLP().toInt<T>(), void())
inline

◆ rlp_dec()

template<typename T >
T taraxa::util::rlp_dec ( RLPDecoderRef  encoding)

◆ rlp_enc() [1/2]

template<typename T >
dev::bytes const& taraxa::util::rlp_enc ( RLPEncoderRef  encoder_to_reuse,
T const &  obj 
)

◆ rlp_enc() [2/2]

template<typename T >
dev::bytes taraxa::util::rlp_enc ( T const &  obj)

◆ rlp_tuple() [1/2]

template<typename... Params>
void taraxa::util::rlp_tuple ( RLPDecoderRef  encoding,
Params &...  args 
)

◆ rlp_tuple() [2/2]

template<typename... Params>
void taraxa::util::rlp_tuple ( RLPEncoderRef  encoding,
Params const &...  args 
)

◆ to_string()

std::string taraxa::util::to_string ( Json::Value const &  json,
bool  no_indent = true 
)

◆ writeJsonToFile()

void taraxa::util::writeJsonToFile ( const std::string &  file_name,
const Json::Value &  json 
)