LCOV - code coverage report
Current view: top level - include/daemon/classes - rpc_data.hpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 4 4 100.0 %
Date: 2024-04-23 00:09:24 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   Copyright 2018-2024, Barcelona Supercomputing Center (BSC), Spain
       3             :   Copyright 2015-2024, Johannes Gutenberg Universitaet Mainz, Germany
       4             : 
       5             :   This software was partially supported by the
       6             :   EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).
       7             : 
       8             :   This software was partially supported by the
       9             :   ADA-FS project under the SPPEXA project funded by the DFG.
      10             : 
      11             :   This file is part of GekkoFS.
      12             : 
      13             :   GekkoFS is free software: you can redistribute it and/or modify
      14             :   it under the terms of the GNU General Public License as published by
      15             :   the Free Software Foundation, either version 3 of the License, or
      16             :   (at your option) any later version.
      17             : 
      18             :   GekkoFS is distributed in the hope that it will be useful,
      19             :   but WITHOUT ANY WARRANTY; without even the implied warranty of
      20             :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      21             :   GNU General Public License for more details.
      22             : 
      23             :   You should have received a copy of the GNU General Public License
      24             :   along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.
      25             : 
      26             :   SPDX-License-Identifier: GPL-3.0-or-later
      27             : */
      28             : 
      29             : #ifndef LFS_RPC_DATA_HPP
      30             : #define LFS_RPC_DATA_HPP
      31             : 
      32             : #include <daemon/daemon.hpp>
      33             : 
      34             : namespace gkfs {
      35             : 
      36             : /* Forward declarations */
      37             : namespace rpc {
      38             : class Distributor;
      39             : }
      40             : 
      41             : 
      42             : namespace daemon {
      43             : 
      44             : class RPCData {
      45             : 
      46             : private:
      47          33 :     RPCData() {}
      48             : 
      49             :     // Margo IDs. They can also be used to retrieve the Mercury classes and
      50             :     // contexts that were created at init time
      51             :     margo_instance_id server_rpc_mid_;
      52             : 
      53             :     // Argobots I/O pools and execution streams
      54             :     ABT_pool io_pool_;
      55             :     std::vector<ABT_xstream> io_streams_;
      56             :     std::string self_addr_str_;
      57             :     // Distributor
      58             :     std::shared_ptr<gkfs::rpc::Distributor> distributor_;
      59             : 
      60             : public:
      61             :     static RPCData*
      62        1232 :     getInstance() {
      63        1232 :         static RPCData instance;
      64        1232 :         return &instance;
      65             :     }
      66             : 
      67             :     RPCData(RPCData const&) = delete;
      68             : 
      69             :     void
      70             :     operator=(RPCData const&) = delete;
      71             : 
      72             :     // Getter/Setter
      73             : 
      74             :     margo_instance*
      75             :     server_rpc_mid();
      76             : 
      77             :     void
      78             :     server_rpc_mid(margo_instance* server_rpc_mid);
      79             : 
      80             :     ABT_pool
      81             :     io_pool() const;
      82             : 
      83             :     void
      84             :     io_pool(ABT_pool io_pool);
      85             : 
      86             :     std::vector<ABT_xstream>&
      87             :     io_streams();
      88             : 
      89             :     void
      90             :     io_streams(const std::vector<ABT_xstream>& io_streams);
      91             : 
      92             :     const std::string&
      93             :     self_addr_str() const;
      94             : 
      95             :     void
      96             :     self_addr_str(const std::string& addr_stra);
      97             : 
      98             :     const std::shared_ptr<gkfs::rpc::Distributor>&
      99             :     distributor() const;
     100             : 
     101             :     void
     102             :     distributor(const std::shared_ptr<gkfs::rpc::Distributor>& distributor);
     103             : };
     104             : 
     105             : } // namespace daemon
     106             : } // namespace gkfs
     107             : 
     108             : #endif // LFS_RPC_DATA_HPP

Generated by: LCOV version 1.16