Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
dev::eth::ICAP Class Reference

Encapsulation of an ICAP address. More...

#include <ICAP.h>

Collaboration diagram for dev::eth::ICAP:
[legend]

Public Types

enum  Type { Invalid, Direct, Indirect }
 Type of ICAP address. More...
 

Public Member Functions

 ICAP ()=default
 Construct null ICAP object. More...
 
 ICAP (Address const &_target)
 Construct a direct ICAP object for given target address. Must have a zero first byte. More...
 
 ICAP (std::string const &_client, std::string const &_inst)
 Construct an indirect ICAP object for given client and institution names. More...
 
 ICAP (std::string const &_c, std::string const &_i, std::string const &_a)
 Construct an indirect ICAP object for given client, institution and asset names. You generally don't want to use this. More...
 
std::string encoded () const
 
Type type () const
 
Address const & direct () const
 
std::string const & asset () const
 
std::string const & target () const
 
std::string const & institution () const
 
std::string const & client () const
 
std::pair< Address, bytesaddress (std::function< bytes(Address, bytes)> const &_call, Address const &_reg) const
 
std::pair< Address, byteslookup (std::function< bytes(Address, bytes)> const &_call, Address const &_reg) const
 

Static Public Member Functions

static Secret createDirect ()
 Create a direct address for ICAP. More...
 
static std::string iban (std::string _c, std::string _d)
 
static std::pair< std::string, std::string > fromIBAN (std::string _iban)
 
static ICAP decoded (std::string const &_encoded)
 

Private Attributes

Type m_type = Invalid
 
Address m_direct
 
std::string m_client
 
std::string m_institution
 
std::string m_asset
 

Detailed Description

Encapsulation of an ICAP address.

Can be encoded, decoded, looked-up and inspected.

Definition at line 45 of file ICAP.h.

Member Enumeration Documentation

Type of ICAP address.

Enumerator
Invalid 
Direct 
Indirect 

Definition at line 58 of file ICAP.h.

Constructor & Destructor Documentation

dev::eth::ICAP::ICAP ( )
default

Construct null ICAP object.

dev::eth::ICAP::ICAP ( Address const &  _target)
inline

Construct a direct ICAP object for given target address. Must have a zero first byte.

Definition at line 51 of file ICAP.h.

dev::eth::ICAP::ICAP ( std::string const &  _client,
std::string const &  _inst 
)
inline

Construct an indirect ICAP object for given client and institution names.

Definition at line 53 of file ICAP.h.

dev::eth::ICAP::ICAP ( std::string const &  _c,
std::string const &  _i,
std::string const &  _a 
)
inline

Construct an indirect ICAP object for given client, institution and asset names. You generally don't want to use this.

Definition at line 55 of file ICAP.h.

Member Function Documentation

std::pair<Address, bytes> dev::eth::ICAP::address ( std::function< bytes(Address, bytes)> const &  _call,
Address const &  _reg 
) const
inline
Returns
target address. Always valid, but requires the Registry address and a function to make calls.

Definition at line 91 of file ICAP.h.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string const& dev::eth::ICAP::asset ( ) const
inline
Returns
asset. Only valid when type() == Indirect.

Definition at line 83 of file ICAP.h.

std::string const& dev::eth::ICAP::client ( ) const
inline
Returns
client name. Only valid when type() == Indirect and asset() == "XET".

Definition at line 89 of file ICAP.h.

Secret dev::eth::ICAP::createDirect ( )
static

Create a direct address for ICAP.

Definition at line 67 of file ICAP.cpp.

Here is the call graph for this function:

ICAP dev::eth::ICAP::decoded ( std::string const &  _encoded)
static
Returns
the ICAP object for the ICAP address given.

Definition at line 78 of file ICAP.cpp.

Address const& dev::eth::ICAP::direct ( ) const
inline
Returns
target address. Only valid when type() == Direct.

Definition at line 81 of file ICAP.h.

Here is the caller graph for this function:

std::string dev::eth::ICAP::encoded ( ) const
Returns
the encoded ICAP address.

Definition at line 110 of file ICAP.cpp.

Here is the caller graph for this function:

std::pair< string, string > dev::eth::ICAP::fromIBAN ( std::string  _iban)
static
Returns
Client and data from given IBAN address.

Definition at line 55 of file ICAP.cpp.

string dev::eth::ICAP::iban ( std::string  _c,
std::string  _d 
)
static
Returns
IBAN encoding of client and data.

Definition at line 38 of file ICAP.cpp.

std::string const& dev::eth::ICAP::institution ( ) const
inline
Returns
institution name. Only valid when type() == Indirect and asset() == "XET".

Definition at line 87 of file ICAP.h.

pair< Address, bytes > dev::eth::ICAP::lookup ( std::function< bytes(Address, bytes)> const &  _call,
Address const &  _reg 
) const
Returns
target address. Looks up through the given Registry and call function. Only valid when type() == Indirect.

Definition at line 137 of file ICAP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string const& dev::eth::ICAP::target ( ) const
inline
Returns
target name. Only valid when type() == Indirect and asset() == "ETH".

Definition at line 85 of file ICAP.h.

Type dev::eth::ICAP::type ( ) const
inline
Returns
type of ICAP.

Definition at line 79 of file ICAP.h.

Member Data Documentation

std::string dev::eth::ICAP::m_asset
private

Definition at line 101 of file ICAP.h.

std::string dev::eth::ICAP::m_client
private

Definition at line 99 of file ICAP.h.

Address dev::eth::ICAP::m_direct
private

Definition at line 98 of file ICAP.h.

std::string dev::eth::ICAP::m_institution
private

Definition at line 100 of file ICAP.h.

Type dev::eth::ICAP::m_type = Invalid
private

Definition at line 97 of file ICAP.h.


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