github.com/igggame/nebulas-go@v2.1.0+incompatible/nbre/core/neb_ipc/server/ipc_configuration.h (about)

     1  // Copyright (C) 2018 go-nebulas authors
     2  //
     3  // This file is part of the go-nebulas library.
     4  //
     5  // the go-nebulas library is free software: you can redistribute it and/or
     6  // modify
     7  // it under the terms of the GNU General Public License as published by
     8  // the Free Software Foundation, either version 3 of the License, or
     9  // (at your option) any later version.
    10  //
    11  // the go-nebulas library is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU General Public License
    17  // along with the go-nebulas library.  If not, see
    18  // <http://www.gnu.org/licenses/>.
    19  //
    20  #pragma once
    21  #include "common/common.h"
    22  
    23  namespace neb {
    24  namespace core {
    25  
    26  class ipc_configuration : public util::singleton<ipc_configuration> {
    27  public:
    28    ipc_configuration();
    29    ipc_configuration(const ipc_configuration &cf) = delete;
    30    ipc_configuration &operator=(const ipc_configuration &cf) = delete;
    31    ipc_configuration(ipc_configuration &&cf) = delete;
    32    ~ipc_configuration();
    33  
    34    // nbre root directory
    35    inline const std::string &nbre_root_dir() const { return m_nbre_root_dir; }
    36    inline std::string &nbre_root_dir() { return m_nbre_root_dir; }
    37  
    38    // nbre execute path
    39    inline const std::string &nbre_exe_name() const { return m_nbre_exe_name; }
    40    inline std::string &nbre_exe_name() { return m_nbre_exe_name; }
    41  
    42    // nebulas blockchain database directory
    43    inline const std::string &neb_db_dir() const { return m_neb_db_dir; }
    44    inline std::string &neb_db_dir() { return m_neb_db_dir; }
    45  
    46    // nbre database directory
    47    inline const std::string &nbre_db_dir() const { return m_nbre_db_dir; }
    48    inline std::string &nbre_db_dir() { return m_nbre_db_dir; }
    49  
    50    // nbre log directory
    51    inline const std::string &nbre_log_dir() const { return m_nbre_log_dir; }
    52    inline std::string &nbre_log_dir() { return m_nbre_log_dir; }
    53  
    54    // nbre storage auth table admin address
    55    const std::string &admin_pub_addr() const { return m_admin_pub_addr; }
    56    std::string &admin_pub_addr() { return m_admin_pub_addr; }
    57  
    58    // nbre start height
    59    inline const uint64_t &nbre_start_height() const {
    60      return m_nbre_start_height;
    61    }
    62    inline uint64_t &nbre_start_height() { return m_nbre_start_height; }
    63  
    64  protected:
    65    std::string m_nbre_root_dir;
    66    std::string m_nbre_exe_name;
    67    std::string m_neb_db_dir;
    68    std::string m_nbre_db_dir;
    69    std::string m_nbre_log_dir;
    70    std::string m_admin_pub_addr;
    71    uint64_t m_nbre_start_height;
    72  };
    73  } // namespace core
    74  } // namespace neb