github.com/igggame/nebulas-go@v2.1.0+incompatible/nbre/common/ir_ref.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  
    21  #pragma once
    22  #include "common/common.h"
    23  #include "common/version.h"
    24  
    25  namespace neb {
    26  class ir_ref {
    27  public:
    28    inline ir_ref() {}
    29    inline ir_ref(const std::string &name, version &v)
    30        : m_name(name), m_version(v) {}
    31  
    32    inline const std::string &name() const { return m_name; }
    33    inline std::string &name() { return m_name; }
    34  
    35    inline const version &version() const { return m_version; }
    36    inline class version &version() { return m_version; }
    37  
    38  protected:
    39    std::string m_name;
    40    class version m_version;
    41  };
    42  }