Sha256: 926d96e25665eecabddab0675fec9752aad4132b36a0a064bc5310b354936cf4

Contents?: true

Size: 939 Bytes

Versions: 7

Compression:

Stored size: 939 Bytes

Contents

namespace Rice
{
  inline Arg::Arg(std::string name) : name(name)
  {
  }

  template<typename Arg_Type>
  inline Arg& Arg::operator=(Arg_Type val)
  {
    this->defaultValue_ = val;
    return *this;
  }

  //! Check if this Arg has a default value associated with it
  inline bool Arg::hasDefaultValue() const
  {
    return this->defaultValue_.has_value();
  }

  //! Return a reference to the default value associated with this Arg
  /*! \return the type saved to this Arg
    */
  template<typename Arg_Type>
  inline Arg_Type& Arg::defaultValue()
  {
    return std::any_cast<Arg_Type&>(this->defaultValue_);
  }

  inline Arg& Arg::keepAlive()
  {
    this->isKeepAlive_ = true;
    return *this;
  }

  inline bool Arg::isKeepAlive() const
  {
    return this->isKeepAlive_;
  }

  inline Arg& Arg::setValue()
  {
    isValue_ = true;
    return *this;
  }

  inline bool Arg::isValue() const
  {
    return isValue_;
  }
} // Rice

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rice-4.3.3 rice/Arg.ipp
rice-4.3.2 rice/Arg.ipp
rice-4.3.1 rice/Arg.ipp
rice-4.3.0 rice/Arg.ipp
rice-4.2.1 rice/Arg.ipp
rice-4.2.0 rice/Arg.ipp
rice-4.1.0 rice/Arg.ipp