Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
typename.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deque>
4#include <map>
5#include <vector>
6
7#include <fc/string.hpp>
8
11
12namespace fc {
13 class value;
14 class exception;
15 namespace ip { class address; }
16
17 template<typename... T> struct get_typename;
18 template<> struct get_typename<int8_t> { static const char* name() { return "int8_t"; } };
19 template<> struct get_typename<uint8_t> { static const char* name() { return "uint8_t"; } };
20 template<> struct get_typename<int16_t> { static const char* name() { return "int16_t"; } };
21 template<> struct get_typename<uint16_t> { static const char* name() { return "uint16_t"; } };
22 template<> struct get_typename<int32_t> { static const char* name() { return "int32_t"; } };
23 template<> struct get_typename<uint32_t> { static const char* name() { return "uint32_t"; } };
24 template<> struct get_typename<int64_t> { static const char* name() { return "int64_t"; } };
25 template<> struct get_typename<uint64_t> { static const char* name() { return "uint64_t"; } };
26 template<> struct get_typename<__int128> { static const char* name() { return "int128_t"; } };
27 template<> struct get_typename<unsigned __int128> { static const char* name() { return "uint128_t"; } };
28
29 template<> struct get_typename<double> { static const char* name() { return "double"; } };
30 template<> struct get_typename<float> { static const char* name() { return "float"; } };
31 template<> struct get_typename<bool> { static const char* name() { return "bool"; } };
32 template<> struct get_typename<char> { static const char* name() { return "char"; } };
33 template<> struct get_typename<void> { static const char* name() { return "char"; } };
34 template<> struct get_typename<string> { static const char* name() { return "string"; } };
35 template<> struct get_typename<value> { static const char* name() { return "value"; } };
36 template<> struct get_typename<fc::exception> { static const char* name() { return "fc::exception"; } };
37 template<> struct get_typename<std::vector<char>> { static const char* name() { return "std::vector<char>"; } };
38 template<typename T> struct get_typename<std::vector<T>>
39 {
40 static const char* name() {
41 static std::string n = std::string("std::vector<") + get_typename<T>::name() + ">";
42 return n.c_str();
43 }
44 };
45 template<typename T> struct get_typename<flat_set<T>>
46 {
47 static const char* name() {
48 static std::string n = std::string("flat_set<") + get_typename<T>::name() + ">";
49 return n.c_str();
50 }
51 };
52 template<typename T> struct get_typename< std::deque<T> >
53 {
54 static const char* name()
55 {
56 static std::string n = std::string("std::deque<") + get_typename<T>::name() + ">";
57 return n.c_str();
58 }
59 };
60 template<typename T> struct get_typename<std::optional<T>>
61 {
62 static const char* name() {
63 static std::string n = std::string("optional<") + get_typename<T>::name() + ">";
64 return n.c_str();
65 }
66 };
67 template<typename K,typename V> struct get_typename<std::map<K,V>>
68 {
69 static const char* name() {
70 static std::string n = std::string("std::map<") + get_typename<K>::name() + ","+get_typename<V>::name()+">";
71 return n.c_str();
72 }
73 };
74
75 struct signed_int;
76 struct unsigned_int;
77 template<> struct get_typename<signed_int> { static const char* name() { return "signed_int"; } };
78 template<> struct get_typename<unsigned_int> { static const char* name() { return "unsigned_int"; } };
79
80}
Used to generate a useful error report when an exception is thrown.
Definition exception.hpp:58
namespace sysio::chain
Definition authority.cpp:3
std::string string
Definition string.hpp:10
Definition name.hpp:106
#define value
Definition pkcs11.h:157
#define T(meth, val, expected)
signed short int16_t
Definition stdint.h:122
unsigned short uint16_t
Definition stdint.h:125
signed __int64 int64_t
Definition stdint.h:135
unsigned int uint32_t
Definition stdint.h:126
signed int int32_t
Definition stdint.h:123
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
signed char int8_t
Definition stdint.h:121
static const char * name()
Definition typename.hpp:26
static const char * name()
Definition typename.hpp:31
static const char * name()
Definition typename.hpp:32
static const char * name()
Definition typename.hpp:29
static const char * name()
Definition typename.hpp:36
static const char * name()
Definition typename.hpp:47
static const char * name()
Definition typename.hpp:30
static const char * name()
Definition typename.hpp:20
static const char * name()
Definition typename.hpp:22
static const char * name()
Definition typename.hpp:24
static const char * name()
Definition typename.hpp:18
static const char * name()
Definition typename.hpp:77
static const char * name()
Definition typename.hpp:34
static const char * name()
Definition typename.hpp:21
static const char * name()
Definition typename.hpp:23
static const char * name()
Definition typename.hpp:25
static const char * name()
Definition typename.hpp:19
static const char * name()
Definition typename.hpp:78
static const char * name()
Definition typename.hpp:35
static const char * name()
Definition typename.hpp:33
static const char * name()
serializes a 32 bit signed interger in as few bytes as possible
Definition varint.hpp:41