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

C++ MissingArgumentException函数代码示例

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

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



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

示例1: MissingArgumentException

float ReceivedMessageArgument::AsFloat() const
{
    if( !typeTagPtr_ )
        throw MissingArgumentException();
	else if( *typeTagPtr_ == FLOAT_TYPE_TAG )
		return AsFloatUnchecked();
	else
		throw WrongArgumentTypeException();
}
开发者ID:stereolux,项目名称:MyoOSC,代码行数:9,代码来源:OscReceivedElements.cpp


示例2: MissingArgumentException

const char* ReceivedMessageArgument::AsSymbol() const
{
    if( !typeTagPtr_ )
        throw MissingArgumentException();
	else if( *typeTagPtr_ == SYMBOL_TYPE_TAG )
		return argumentPtr_;
	else
		throw WrongArgumentTypeException();
}
开发者ID:8c6794b6,项目名称:supercollider,代码行数:9,代码来源:OscReceivedElements.cpp


示例3: MissingArgumentException

void ReceivedMessageArgument::AsBlob( const void*& data, unsigned long& size ) const
{
    if( !typeTag_ )
        throw MissingArgumentException();
	else if( *typeTag_ == BLOB_TYPE_TAG )
		AsBlobUnchecked( data, size );
	else
		throw WrongArgumentTypeException();
}
开发者ID:miguel-negrao,项目名称:SCGraph,代码行数:9,代码来源:OscReceivedElements.cpp


示例4: MissingArgumentException

bool ReceivedMessageArgument::AsBool() const
{
    if( !typeTag_ )
        throw MissingArgumentException();
	else if( *typeTag_ == TRUE_TYPE_TAG )
		return true;
	else if( *typeTag_ == FALSE_TYPE_TAG )
		return false;
	else
		throw WrongArgumentTypeException();
}
开发者ID:2mc,项目名称:supercollider,代码行数:11,代码来源:OscReceivedElements.cpp


示例5: MissingArgumentException

void Option::process(const std::string& option, std::string& arg) const
{
	std::string::size_type pos = option.find_first_of(":=");
	std::string::size_type len = pos == std::string::npos ? option.length() : pos;
	if (icompare(option, 0, len, _fullName, 0, len) == 0)
	{
		if (takesArgument())
		{
			if (argumentRequired() && pos == std::string::npos)
				throw MissingArgumentException(_fullName + " requires " + argumentName());
			if (pos != std::string::npos)
				arg.assign(option, pos + 1, option.length() - pos - 1);
			else
				arg.clear();
		}
		else if (pos != std::string::npos)
		{
			throw UnexpectedArgumentException(option);
		}
		else arg.clear();
	}
	else if (!_shortName.empty() && option.compare(0, _shortName.length(), _shortName) == 0)
	{
		if (takesArgument())
		{
			if (argumentRequired() && option.length() == _shortName.length())
				throw MissingArgumentException(_shortName + " requires " + argumentName());
			arg.assign(option, _shortName.length(), option.length() - _shortName.length());
		}
		else if (option.length() != _shortName.length())
		{
			throw UnexpectedArgumentException(option);
		}
		else arg.clear();
	}
	else throw UnknownOptionException(option);
}
开发者ID:Alcibiades586,项目名称:roadrunner,代码行数:37,代码来源:Option.cpp


示例6: MissingArgumentException

/*** Evaluate this object ***/
Object* Equal::evaluate()
{
	if(arg1 == 0)
		throw MissingArgumentException(getLineNumber(), getColumnNumber(), OBJ_INTEGER | OBJ_REAL | OBJ_SEQUENCE | OBJ_TEXT | OBJ_LOGICAL, 1);
	if(arg2 == 0)
		throw MissingArgumentException(getLineNumber(), getColumnNumber(), OBJ_INTEGER | OBJ_REAL | OBJ_SEQUENCE | OBJ_TEXT | OBJ_LOGICAL, 2);

	std::auto_ptr<Object> obj1(arg1->evaluate());
	std::auto_ptr<Object> obj2(arg2->evaluate());

	if(obj1->getType() == OBJ_EMPTY && obj2->getType() == OBJ_EMPTY)
		return new Logical(true);

	if(obj1->getType() == OBJ_EMPTY || obj2->getType() == OBJ_EMPTY)
		return new Logical(false);

	if(obj1->getType() == OBJ_LOGICAL)
	{
		if(obj2->getType() != OBJ_LOGICAL)
			throw InvalidTypeException(getLineNumber(), getColumnNumber(), OBJ_LOGICAL, obj2->getType(), 2);

		Logical* cast1 = static_cast<Logical*>(obj1.get());
		Logical* cast2 = static_cast<Logical*>(obj2.get());
		return new Logical(cast1->getValue() == cast2->getValue());
	}

	if(obj1->getType() == OBJ_INTEGER)
	{
		Integer* cast1 = static_cast<Integer*>(obj1.get());

		if(obj2->getType() == OBJ_INTEGER)
		{
			Integer* cast2 = static_cast<Integer*>(obj2.get());
			return new Logical(cast1->getValue() == cast2->getValue());
		}

		if(obj2->getType() == OBJ_REAL)
		{
			Real* cast2 = static_cast<Real*>(obj2.get());
			return new Logical(cast1->getValue() == cast2->getValue());
		}
		
		throw InvalidTypeException(getLineNumber(), getColumnNumber(), OBJ_INTEGER | OBJ_REAL, obj2->getType(), 2);
	}

	if(obj1->getType() == OBJ_REAL)
	{
		Real* cast1 = static_cast<Real*>(obj1.get());

		if(obj2->getType() == OBJ_INTEGER)
		{
			Integer* cast2 = static_cast<Integer*>(obj2.get());
			return new Logical(cast1->getValue() == cast2->getValue());
		}

		if(obj2->getType() == OBJ_REAL)
		{
			Real* cast2 = static_cast<Real*>(obj2.get());
			return new Logical(cast1->getValue() == cast2->getValue());
		}
		
		throw InvalidTypeException(getLineNumber(), getColumnNumber(), OBJ_INTEGER | OBJ_REAL, obj2->getType(), 2);
	}

	if(obj1->getType() == OBJ_TEXT)
	{
		if(obj2->getType() != OBJ_TEXT)
			throw InvalidTypeException(getLineNumber(), getColumnNumber(), OBJ_TEXT, obj2->getType(), 2);

		Text* cast1 = static_cast<Text*>(obj1.get());
		Text* cast2 = static_cast<Text*>(obj2.get());
		return new Logical(cast1->getValue().compare(cast2->getValue()) == 0);
	}

	if(obj1->getType() == OBJ_SEQUENCE)
	{
		if(obj2->getType() != OBJ_SEQUENCE)
			throw InvalidTypeException(getLineNumber(), getColumnNumber(), OBJ_SEQUENCE, obj2->getType(), 2);

		Sequence* cast1 = static_cast<Sequence*>(obj1.get());
		Sequence* cast2 = static_cast<Sequence*>(obj2.get());

		if(cast1->getLength() != cast2->getLength())
			return new Logical(false);

		for(unsigned int i = 0; i < cast1->getLength(); i++)
		{
			std::auto_ptr<Object> eqResult(Equal(cast1->getObject(i)->clone(), cast2->getObject(i)->clone()).evaluate());
			Logical* logResult = static_cast<Logical*>(eqResult.get());
			if(logResult->getValue() == false)
				return new Logical(false);
		}

		return new Logical(true);
	}

	throw InvalidTypeException(getLineNumber(), getColumnNumber(), OBJ_LOGICAL | OBJ_REAL | OBJ_TEXT | OBJ_SEQUENCE | OBJ_INTEGER, obj1->getType(), 1);
	return 0;
}
开发者ID:denrusio,项目名称:vak-opensource,代码行数:100,代码来源:equal.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Mix_AllocateChannels函数代码示例发布时间:2022-05-30
下一篇:
C++ MiniportMMRequest函数代码示例发布时间: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