Electroneum
Electroneum::SubaddressAccountImpl Class Reference

#include <subaddress_account.h>

Inheritance diagram for Electroneum::SubaddressAccountImpl:
Collaboration diagram for Electroneum::SubaddressAccountImpl:

Public Member Functions

 SubaddressAccountImpl (WalletImpl *wallet)
 
 ~SubaddressAccountImpl ()
 
void refresh ()
 
std::vector< SubaddressAccountRow * > getAll () const
 
void addRow (const std::string &label)
 
void setLabel (uint32_t accountIndex, const std::string &label)
 

Detailed Description

Definition at line 36 of file subaddress_account.h.

Constructor & Destructor Documentation

◆ SubaddressAccountImpl()

Electroneum::SubaddressAccountImpl::SubaddressAccountImpl ( WalletImpl wallet)

Definition at line 41 of file subaddress_account.cpp.

42  : m_wallet(wallet) {}

◆ ~SubaddressAccountImpl()

Electroneum::SubaddressAccountImpl::~SubaddressAccountImpl ( )

Definition at line 87 of file subaddress_account.cpp.

88 {
89  clearRows();
90 }

Member Function Documentation

◆ addRow()

void Electroneum::SubaddressAccountImpl::addRow ( const std::string &  label)
virtual

Implements Electroneum::SubaddressAccount.

Definition at line 44 of file subaddress_account.cpp.

45 {
46  m_wallet->m_wallet->add_subaddress_account(label);
47  refresh();
48 }
Here is the call graph for this function:

◆ getAll()

std::vector< SubaddressAccountRow * > Electroneum::SubaddressAccountImpl::getAll ( ) const
virtual

Implements Electroneum::SubaddressAccount.

Definition at line 82 of file subaddress_account.cpp.

83 {
84  return m_rows;
85 }

◆ refresh()

void Electroneum::SubaddressAccountImpl::refresh ( )
virtual

Implements Electroneum::SubaddressAccount.

Definition at line 56 of file subaddress_account.cpp.

57 {
58  LOG_PRINT_L2("Refreshing subaddress account");
59 
60  clearRows();
61  for (uint32_t i = 0; i < m_wallet->m_wallet->get_num_subaddress_accounts(); ++i)
62  {
63  m_rows.push_back(new SubaddressAccountRow(
64  i,
65  m_wallet->m_wallet->get_subaddress_as_str({i,0}),
66  m_wallet->m_wallet->get_subaddress_label({i,0}),
67  cryptonote::print_etn(m_wallet->m_wallet->balance(i, false)),
68  cryptonote::print_etn(m_wallet->m_wallet->unlocked_balance(i, false)),
69  cryptonote::print_etn(m_wallet->m_wallet->balance(i, true)),
70  cryptonote::print_etn(m_wallet->m_wallet->unlocked_balance(i, true))
71  ));
72  }
73 }
#define LOG_PRINT_L2(x)
Definition: misc_log_ex.h:101
std::string print_etn(uint64_t amount, unsigned int decimal_point)
unsigned int uint32_t
Definition: stdint.h:126
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLabel()

void Electroneum::SubaddressAccountImpl::setLabel ( uint32_t  accountIndex,
const std::string &  label 
)
virtual

Implements Electroneum::SubaddressAccount.

Definition at line 50 of file subaddress_account.cpp.

51 {
52  m_wallet->m_wallet->set_subaddress_label({accountIndex, 0}, label);
53  refresh();
54 }
Here is the call graph for this function:

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