Sha256: da23011afd3e68a28007d8ab3a163cfcf71a0c2432fb42e7c2fd7341d6935db8

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

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 Arg& Arg::isValue()
  {
    isValue_ = true;
    return *this;
  }

  inline bool Arg::getIsValue()
  {
    return isValue_;
  }

  // Function to overload the, operator
  inline Arg Arg::operator,(const Arg& other)
  {
    throw std::runtime_error("The Arg class no longer supports the comma operator, please remove the surounding parentheses");
  }
} // Rice

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rice-4.0.4 rice/Arg.ipp
rice-4.0.3 rice/Arg.ipp
rice-4.0.2 rice/Arg.ipp
rice-4.0.1 rice/Arg.ipp
rice-4.0.0 rice/Arg.ipp