• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ InvalidArgumentException函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中InvalidArgumentException函数的典型用法代码示例。如果您正苦于以下问题:C++ InvalidArgumentException函数的具体用法?C++ InvalidArgumentException怎么用?C++ InvalidArgumentException使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了InvalidArgumentException函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Vector3f

 bool Vector3f::AnyGreaterEqual(const Vector3f& other, F32 epsilon /*= Epsilon*/) const {
     if (epsilon >= 0.0f) {
         Vector3f temp = other - Vector3f(epsilon);
         return temp.x >= epsilon || temp.y >= epsilon || temp.z >= epsilon;
     } else {
         throw InvalidArgumentException("epsilon");
     }
 }
开发者ID:panmar,项目名称:pg3,代码行数:8,代码来源:Vector.cpp


示例2: InvalidArgumentException

 bool Vector2f::AnyLess(const Vector2f& other, F32 epsilon /*= Epsilon*/) const {
     if (epsilon >= 0.0f) {
         Vector2f temp = other + epsilon;
         return x < temp.x || y < temp.y;
     } else {
         throw InvalidArgumentException("epsilon");
     }
 }
开发者ID:panmar,项目名称:pg3,代码行数:8,代码来源:Vector.cpp


示例3: Abs

 bool Vector3f::AllEqual(const Vector3f& other, F32 epsilon /*= Epsilon*/) const {
     if (epsilon >= 0.0f) {
         Vector3f diff = Abs(*this - other);
         return (diff.x <= epsilon && diff.y <= epsilon && diff.z <= epsilon);
     } else {
         throw InvalidArgumentException("epsilon");
     }
 }
开发者ID:panmar,项目名称:pg3,代码行数:8,代码来源:Vector.cpp


示例4: format

void BoundingSphere::SetRadius(F32 radius) {
    if (radius > 0.0f) {
        this->radius = radius;
    } else {
        string message = format("Invalid radius value '%f'", radius);
        throw InvalidArgumentException(message);
    }
}
开发者ID:panmar,项目名称:pg3,代码行数:8,代码来源:BoundingVolumes.cpp


示例5: switch

void SerialConfigImpl::setParityImpl(SerialConfigImpl::ParityImpl parity)
{
	switch (parity)
	{
	case PARITY_NONE_IMPL:
		return setParityCharImpl('N');
	case PARITY_ODD_IMPL:
		return setParityCharImpl('O');
	case PARITY_EVEN_IMPL:
		return setParityCharImpl('E');
	case PARITY_MARK_IMPL:
	default:
		throw InvalidArgumentException();
	}

	throw InvalidArgumentException("Wrong parity.");
}
开发者ID:RangelReale,项目名称:sandbox,代码行数:17,代码来源:SerialConfig_POSIX.cpp


示例6: InvalidArgumentException

RawSocket& RawSocket::operator = (const Socket& socket)
{
	if (dynamic_cast<RawSocketImpl*>(socket.impl()))
		Socket::operator = (socket);
	else
		throw InvalidArgumentException("Cannot assign incompatible socket");
	return *this;
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:8,代码来源:RawSocket.cpp


示例7: while

void FileChannel::setPurgeAge(const std::string& age)
{
	delete _pPurgeStrategy;
	_pPurgeStrategy = 0;
	_purgeAge = "none";
	if (age.empty() || 0 == icompare(age, "none"))
		return;

	std::string::const_iterator it = age.begin();
	std::string::const_iterator end = age.end();

	int n = 0;
	while (it != end && Ascii::isSpace(*it))
		++it;
	while (it != end && Ascii::isDigit(*it))
	{
		n *= 10;
		n += *it++ - '0';
	}
	while (it != end && Ascii::isSpace(*it))
		++it;
	std::string unit;
	while (it != end && Ascii::isAlpha(*it))
		unit += *it++;
	
	Timespan::TimeDiff factor = Timespan::SECONDS;
	if (unit == "minutes")
		factor = Timespan::MINUTES;
	else if (unit == "hours")
		factor = Timespan::HOURS;
	else if (unit == "days")
		factor = Timespan::DAYS;
	else if (unit == "weeks")
		factor = 7*Timespan::DAYS;
	else if (unit == "months")
		factor = 30 * Timespan::DAYS;
	else if (unit != "seconds")
		throw InvalidArgumentException("purgeAge", age);

	if (0 == n)
		throw InvalidArgumentException("Zero is not valid purge age.");

	_pPurgeStrategy = new PurgeByAgeStrategy(Timespan(factor * n));
	_purgeAge = age;
}
开发者ID:RageStormers,项目名称:poco,代码行数:45,代码来源:FileChannel.cpp


示例8: InvalidArgumentException

int ICMPEventArgs::replyTime(int index) const
{
	if (0 == _rtt.size()) 
		throw InvalidArgumentException("Supplied index exceeds array capacity.");

	if (-1 == index) index = _sent - 1;

	return _rtt[index];
}
开发者ID:carvalhomb,项目名称:tsmells,代码行数:9,代码来源:ICMPEventArgs.cpp


示例9: InvalidArgumentException

String StringUtil::Translate(CStrRef input, CStrRef from, CStrRef to) {
  if (input.empty()) return input;

  if (from.empty()) {
    throw InvalidArgumentException("from", "(empty)");
  }
  if (from.size() != to.size()) {
    throw InvalidArgumentException("from and to", "(different sizes)");
  }

  int len = input.size();
  char *ret = (char *)malloc(len + 1);
  memcpy(ret, input, len);
  ret[len] = '\0';

  string_translate(ret, len, from, to, from.size());
  return String(ret, len, AttachString);
}
开发者ID:Neomeng,项目名称:hiphop-php,代码行数:18,代码来源:string_util.cpp


示例10: InvalidArgumentException

    AppearanceDataIC ICAAMModel::getModel(int scale) const
    {
        if (scale < 0 || scale >= this->modelData.size())
        {
            throw InvalidArgumentException();
        }

        return this->modelData[scale];
    }
开发者ID:coolbatch,项目名称:AAMToolbox,代码行数:9,代码来源:ICAAMModel.cpp


示例11: _source

Query::Query(const Var& source): _source(source)
{
	if (!source.isEmpty() &&
		source.type() != typeid(Object) &&
		source.type() != typeid(Object::Ptr) &&
		source.type() != typeid(Array) &&
		source.type() != typeid(Array::Ptr))
		throw InvalidArgumentException("Only JSON Object, Array or pointers thereof allowed.");
}
开发者ID:Mobiletainment,项目名称:Multiplayer-Network-Conecpts,代码行数:9,代码来源:Query.cpp


示例12: InvalidArgumentException

DynamicAny DynamicAny::operator -- (int)
{
	if (!isInteger())
		throw InvalidArgumentException("Invalid operation for this data type.");

	DynamicAny tmp(*this);
	*this -= 1;
	return tmp;
}
开发者ID:carvalhomb,项目名称:tsmells,代码行数:9,代码来源:DynamicAny.cpp


示例13: InvalidAccessException

int SerialChannelImpl::readImpl(char*& pBuffer)
{
	if (!_pConfig->getUseEOFImpl())
		throw InvalidAccessException();

	int bufSize = _pConfig->getBufferSizeImpl();
	int it = 1;

	if ((0 == bufSize) || (0 != pBuffer))
		throw InvalidArgumentException();

	std::string buffer;
	DWORD read = 0;
	DWORD readCount = 0;

	pBuffer = static_cast<char*>(std::calloc(bufSize, sizeof(char)));//! freed in parent call

	do
    {
		if (_leftOver.size())
		{
			read = _leftOver.size() > bufSize - readCount ? bufSize - readCount : _leftOver.size();
			std::memcpy(pBuffer + readCount, _leftOver.data(), read);
			if (read == _leftOver.size())
				_leftOver.clear();
			else
				_leftOver.assign(_leftOver, read, _leftOver.size() - read);
		}
		else
		{
			if (!ReadFile(_handle, pBuffer + readCount, bufSize - readCount, &read, NULL)) 
				handleError(_pConfig->name());
			else if (0 == read) break;
		}

		poco_assert (read <= bufSize - readCount);
		
		buffer.assign(static_cast<char*>(pBuffer + readCount), read);
		size_t pos = buffer.find(_pConfig->getEOFCharImpl());
		if (pos != buffer.npos)
		{
			readCount += static_cast<DWORD>(pos);
			PurgeComm(_handle, PURGE_RXCLEAR);
			_leftOver.assign(buffer, pos + 1, buffer.size() - pos - 1);
			break;
		}

		readCount += read;
		if (readCount >= bufSize)
		{
			bufSize *= ++it;
			pBuffer = static_cast<char*>(std::realloc(pBuffer, bufSize * sizeof(char)));
		}
	}while(true);

	return readCount;
}
开发者ID:RangelReale,项目名称:sandbox,代码行数:57,代码来源:SerialChannel_WIN32.cpp


示例14: switch

void Preparator::freeMemory() const
{
	IndexMap::iterator it = _varLengthArrays.begin();
	IndexMap::iterator end = _varLengthArrays.end();
	for (; it != end; ++it)
	{
		switch (it->second)
		{
			case DT_BOOL:
				deleteCachedArray<bool>(it->first);
				break;

			case DT_CHAR:
				deleteCachedArray<char>(it->first);
				break;

			case DT_WCHAR:
				deleteCachedArray<UTF16String>(it->first);
				break;

			case DT_UCHAR:
				deleteCachedArray<unsigned char>(it->first);
				break;

			case DT_CHAR_ARRAY:
			{
				char** pc = AnyCast<char*>(&_values[it->first]);
				if (pc) std::free(*pc);
				break;
			}

			case DT_WCHAR_ARRAY:
			{
				UTF16String::value_type** pc = AnyCast<UTF16String::value_type*>(&_values[it->first]);
				if (pc) std::free(*pc);
				break;
			}

			case DT_UCHAR_ARRAY:
			{
				unsigned char** pc = AnyCast<unsigned char*>(&_values[it->first]);
				if (pc) std::free(*pc);
				break;
			}

			case DT_BOOL_ARRAY:
			{
				bool** pb = AnyCast<bool*>(&_values[it->first]);
				if (pb) std::free(*pb);
				break;
			}

			default:
				throw InvalidArgumentException("Unknown data type.");
		}
	}
}
开发者ID:12307,项目名称:poco,代码行数:57,代码来源:Preparator.cpp


示例15: InvalidArgumentException

const Any& GraphicsEngine::GetEnvVariable(const std::string& name) {
	auto it = m_envVariables.find(name);
	if (it != m_envVariables.end()) {
		return it->second;
	}
	else {
		throw InvalidArgumentException("Environment variable does not exist.");
	}
}
开发者ID:petiaccja,项目名称:Inline-Engine,代码行数:9,代码来源:GraphicsEngine.cpp


示例16: BufferedBidirectionalStreamBuf

SocketStreamBuf::SocketStreamBuf(const Socket& socket): 
	BufferedBidirectionalStreamBuf(STREAM_BUFFER_SIZE, std::ios::in | std::ios::out),
	_pImpl(dynamic_cast<StreamSocketImpl*>(socket.impl()))
{
	if (_pImpl)
		_pImpl->duplicate(); 
	else
		throw InvalidArgumentException("Invalid or null SocketImpl passed to SocketStreamBuf");
}
开发者ID:RobertoMalatesta,项目名称:sandbox,代码行数:9,代码来源:SocketStream.cpp


示例17: InvalidArgumentException

void StringData::attach(char *data, int len) {
  if (uint32_t(len) > MaxSize) {
    throw InvalidArgumentException("len>=2^30", len);
  }
  releaseData();
  m_len = len;
  m_data = data;
  m_big.cap = len | IsMalloc;
}
开发者ID:RepmujNetsik,项目名称:hiphop-php,代码行数:9,代码来源:string_data.cpp


示例18: getType

int Array::getType(size_t pos) const
{
	if (_elements.isNull()) throw NullValueException();

	if (pos >= _elements.value().size()) throw InvalidArgumentException();

	RedisType::Ptr element = _elements.value().at(pos);
	return element->type();
}
开发者ID:macchina-io,项目名称:macchina.io,代码行数:9,代码来源:Array.cpp


示例19: m_name

UserStreamWrapper::UserStreamWrapper(const String& name,
                                     const String& clsname,
                                     int flags)
    : m_name(name) {
  m_cls = Unit::loadClass(clsname.get());
  if (!m_cls) {
    throw InvalidArgumentException(0, "Undefined class '%s'", clsname.data());
  }
  m_isLocal = !(flags & k_STREAM_IS_URL);
}
开发者ID:2bj,项目名称:hhvm,代码行数:10,代码来源:user-stream-wrapper.cpp


示例20: m_name

UserStreamWrapper::UserStreamWrapper(CStrRef name, CStrRef clsname) :
  m_name(name) {
  m_cls = Unit::loadClass(clsname.get());
  if (!m_cls) {
    throw InvalidArgumentException(0, "Undefined class '%s'", clsname.data());
  }
  // There is a third param in Zend to stream_wrapper_register() which could
  // affect that when we add that param
  m_isLocal = true;
}
开发者ID:IMGM,项目名称:hiphop-php,代码行数:10,代码来源:user_stream_wrapper.cpp



注:本文中的InvalidArgumentException函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ InvalidStateException函数代码示例发布时间:2022-05-30
下一篇:
C++ InvalidArgument函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap