Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ParameterType Class Reference

The ParameterType class Decode the api parameter type, provide more informations about the data type that can be used for encoding and decoding. More...

#include <contractabi.h>

Public Types

enum  Type {
  abi_none, abi_bytes, abi_string, abi_uint,
  abi_int, abi_address, abi_bool, abi_fixed,
  abi_ufixed, abi_function
}
 The Type enum ABI data types. More...
 

Public Member Functions

 ParameterType (const std::string &_type="")
 ParameterType Constructor. More...
 
bool determine (const std::string &_type)
 determine Determine the type from the string More...
 
size_t wholeBits () const
 wholeBits Get the number of bits for the whole part of the number More...
 
size_t decimalBits () const
 decimalBits Get the number of bits for the decimal part of the number More...
 
size_t totalBytes () const
 totalBytes Get the total size in bytes More...
 
size_t length () const
 length Length of the list, applicable for list only More...
 
bool isList () const
 isList Is the data type list More...
 
bool isDynamic () const
 isDynamic Check if the type is dynamic. More...
 
bool isValid () const
 isValid Check if the type is valid More...
 
const std::string & canonical () const
 canonical Get the canonical type More...
 
Type type () const
 type Get the type More...
 

Private Member Functions

void clean ()
 clean Set the value to the defaults More...
 

Private Attributes

Type m_type
 
int m_whole
 
int m_decimal
 
int m_length
 
bool m_isList
 
bool m_valid
 
std::string m_canonical
 

Detailed Description

The ParameterType class Decode the api parameter type, provide more informations about the data type that can be used for encoding and decoding.

Definition at line 22 of file contractabi.h.

Member Enumeration Documentation

The Type enum ABI data types.

Enumerator
abi_none 
abi_bytes 
abi_string 
abi_uint 
abi_int 
abi_address 
abi_bool 
abi_fixed 
abi_ufixed 
abi_function 

Definition at line 28 of file contractabi.h.

Constructor & Destructor Documentation

ParameterType::ParameterType ( const std::string &  _type = "")

ParameterType Constructor.

Definition at line 594 of file contractabi.cpp.

Here is the call graph for this function:

Member Function Documentation

const std::string & ParameterType::canonical ( ) const

canonical Get the canonical type

Returns
String representation of the type

Definition at line 792 of file contractabi.cpp.

Here is the caller graph for this function:

void ParameterType::clean ( )
private

clean Set the value to the defaults

Definition at line 797 of file contractabi.cpp.

Here is the caller graph for this function:

size_t ParameterType::decimalBits ( ) const

decimalBits Get the number of bits for the decimal part of the number

Returns
Number of bits

Definition at line 751 of file contractabi.cpp.

bool ParameterType::determine ( const std::string &  _type)

determine Determine the type from the string

Parameters
_typeString representation of the type
Returns
true: type determined, false: type not determined

Definition at line 605 of file contractabi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ParameterType::isDynamic ( ) const

isDynamic Check if the type is dynamic.

Dynamic type include pointer to the location where the content starts.

Returns
true: is dynamic, false: is static

Definition at line 771 of file contractabi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ParameterType::isList ( ) const

isList Is the data type list

Returns
true: is list, false: not list

Definition at line 766 of file contractabi.cpp.

Here is the caller graph for this function:

bool ParameterType::isValid ( ) const

isValid Check if the type is valid

Returns
true: is valid, false: not valid

Definition at line 787 of file contractabi.cpp.

size_t ParameterType::length ( void  ) const

length Length of the list, applicable for list only

Returns
Length of the list

Definition at line 761 of file contractabi.cpp.

Here is the caller graph for this function:

size_t ParameterType::totalBytes ( ) const

totalBytes Get the total size in bytes

Returns
Number of bytes

Definition at line 756 of file contractabi.cpp.

Here is the caller graph for this function:

ParameterType::Type ParameterType::type ( ) const

type Get the type

Returns
Decoded type

Definition at line 808 of file contractabi.cpp.

Here is the caller graph for this function:

size_t ParameterType::wholeBits ( ) const

wholeBits Get the number of bits for the whole part of the number

Returns
Number of bits

Definition at line 746 of file contractabi.cpp.

Member Data Documentation

std::string ParameterType::m_canonical
private

Definition at line 121 of file contractabi.h.

int ParameterType::m_decimal
private

Definition at line 117 of file contractabi.h.

bool ParameterType::m_isList
private

Definition at line 119 of file contractabi.h.

int ParameterType::m_length
private

Definition at line 118 of file contractabi.h.

Type ParameterType::m_type
private

Definition at line 115 of file contractabi.h.

bool ParameterType::m_valid
private

Definition at line 120 of file contractabi.h.

int ParameterType::m_whole
private

Definition at line 116 of file contractabi.h.


The documentation for this class was generated from the following files: