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

C++ ParameterException函数代码示例

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

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



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

示例1: ULXR_TRACE

MethodResponse
   Dispatcher::system_methodHelp(const MethodCall &calldata,
                                 const Dispatcher *disp)
{
  ULXR_TRACE("system_methodHelp");
  if (calldata.numParams() != 1)
    throw ParameterException(InvalidMethodParameterError,
                             "Exactly 1 parameter allowed for \"system.methodHelp\"");

  if (calldata.getParam(0).getType() != RpcStrType)
    throw ParameterException(InvalidMethodParameterError,
                             "Parameter 1 not of type \"String\" \"system.listMethods\"");

  RpcString vs = calldata.getParam(0);
  std::string name = vs.getString();
  std::string s;

  MethodCallMap::const_iterator it;
  std::string s_prev;
  for (it = disp->methodcalls.begin(); it != disp->methodcalls.end(); ++it)
    if (name == (*it).first.method_name && (*it).first.documentation.length() != 0)
    {
      if (   s_prev != (*it).first.documentation
          && (*it).first.documentation.length() != 0)
      {
        if (s.length() != 0)
          s = "* " +s + "\n* ";
        s += (*it).first.documentation;
      }
      s_prev = (*it).first.documentation;
    }

  return MethodResponse (RpcString(s));
}
开发者ID:MrMC,项目名称:ulxmlrpcpp,代码行数:34,代码来源:ulxr_dispatcher.cpp


示例2: InitializeRefObjects

//------------------------------------------------------------------------------
// void SetRvector(Integer item, const Rvector &value)
//------------------------------------------------------------------------------
void AttitudeData::SetRvector(Integer item, const Rvector &value)
{
   #ifdef DEBUG_SET_RVECTOR
   MessageInterface::ShowMessage
      ("AttitudeData::SetRvector() entered, item = %d, value = '%s'\n",
       item, value.c_str());
   #endif
   
   if (mSpacecraft == NULL)
      InitializeRefObjects();
   
   Attitude *attitude = (Attitude*)mSpacecraft->GetRefObject(Gmat::ATTITUDE, "");
   if (attitude == NULL)
      throw ParameterException
         ("AttitudeData::SetRvector() Attitude of the Spacecraft \"" +
          mSpacecraft->GetName() + "\" is NULL\n");
   
   switch (item)
   {
   case QUATERNION:
      attitude->SetRvectorParameter("Quaternion", value);
      break;
   default:
      // otherwise, there is an error   
      throw ParameterException
         ("AttitudeData::SetString() Unknown item id: " +
          GmatRealUtil::ToString(item));
   }
}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:32,代码来源:AttitudeData.cpp


示例3: ParameterException

ResultStatus SessionInfoCube::setCellValue(PServer server, PDatabase db, PCubeArea cellPath, CellValue value, PLockedCells lockedCells, PUser user, boost::shared_ptr<PaloSession> session, bool checkArea, bool addValue, SplashMode splashMode, bool bWriteToJournal, User::RightSetting* checkRights, set<PCube> &changedCubes, bool possibleCommit, CubeArea::CellType ct)
{
	if (User::checkUser(user) && user->getRoleRight(User::sysOpRight) < RIGHT_DELETE) {
		throw ParameterException(ErrorException::ERROR_NOT_AUTHORIZED, "insufficient access rights to terminate session!", "user", user ? (int)user->getId() : 0);
	}
	if (value.isString()) {
		ResultStatus result = RESULT_FAILED;
		WriteLocker paloSessionLock(&PaloSession::m_main_Lock);
		IdentifiersType key = *cellPath->pathBegin();
		// find session
		map<IdentifierType, boost::shared_ptr<PaloSession> >::iterator sessionIt = PaloSession::sessionIds.find(key[0]);
		if (sessionIt != PaloSession::sessionIds.end()) {
			string command = value;
			if (command == string("close")) {
				boost::shared_ptr<PaloSession> session = sessionIt->second;
				if (session->isWorker()) {
					session->command = "Invalid command:\""+command+"\"\nSVS session can't be closed";
					throw ErrorException(ErrorException::ERROR_NOT_AUTHORIZED, "SVS session can't be closed");
				}
				session->command = command;
				// terminate all session jobs
				WriteLocker wl(&sessionIt->second->thisLock);
				for (set<const PaloJob *>::iterator jit = sessionIt->second->activeJobs.begin(); jit != sessionIt->second->activeJobs.end(); ++jit) {
					if (*jit) {
						Context *jobContext = const_cast<Context *>((*jit)->getContext());
						if (jobContext) {
							jobContext->stop();
						}
					}
				}
				PaloSession::deleteSession(session, true);
			} else {
#ifdef _DEBUG
				session->command = "Invalid command:\""+command+"\"\nCommands: close - close this session";
#endif
				Logger::warning << "Invalid session command. User: " << (user ? user->getName() : "System") << " Command: '" << command << "'" << endl;
				throw ParameterException(ErrorException::ERROR_INVALID_COMMAND, "Invalid command received", "value", command);
			}
			Logger::info << "Session command accepted. User: " << (user ? user->getName() : "System") << " Command: '" << command << "'" << endl;
			result = RESULT_OK;
		} else {
			throw ParameterException(ErrorException::ERROR_ELEMENT_NOT_FOUND, "session element not found", "element", key[0]);
		}
		return result;
	} else {
		throw ParameterException(ErrorException::ERROR_NOT_AUTHORIZED, "session info cube cannot be modified", "user", user ? (int)user->getId() : 0);
	}
}
开发者ID:abraneo,项目名称:jedox-mirror,代码行数:48,代码来源:SessionInfoCube.cpp


示例4: getElementAccessRight

void RightsDimension::checkElementAccessRight(const User *user, CPDatabase db, RightsType minimumRight) const
{
	RightsType rt = getElementAccessRight(user, db);
	if (rt < minimumRight && (getDimensionType() != Dimension::CONFIG || minimumRight > RIGHT_READ)) {
		throw ParameterException(ErrorException::ERROR_NOT_AUTHORIZED, "insufficient access rights", "user", (int)user->getId());
	}
}
开发者ID:Dalboz,项目名称:molap,代码行数:7,代码来源:RightsDimension.cpp


示例5: engine

LegacyRule::LegacyRule(PEngineBase engine, CPPlanNode node) :
	engine(engine), isValidPath(false), node(node)
{
	Context *context = Context::getContext();
	const LegacyRulePlanNode *legacyRulePlanNode = dynamic_cast<const LegacyRulePlanNode *>(node.get());
	cube = legacyRulePlanNode->getCube();
	db = CONST_COMMITABLE_CAST(Database, context->getParent(cube));
	mem_context = context->getRulesContext();
	ECube *ecube = NewEntryCube(*cube, *db, *engine, context);
	CPRule rule = legacyRulePlanNode->getRule();
	generateEmptyResults = node->getDefaultValue() != 0;

	area.reset(new CubeArea(db, cube, *node->getArea().get()));
	erule = ecube->findRule(rule->getId());
	if (erule && erule->arule) {
		generateSources();
	} else {
		stringstream msg;
		msg << "rule " << rule->getId() << " not found in database " <<  db->getName() << ", cube " << cube->getName() << ", erule";
		if (erule) {
			msg << "->nr_rule: " << erule->nr_rule << ", erule->arule: NULL";
		} else {
			msg << ": NULL";
		}
		Logger::error << msg.str() << endl;
		throw ParameterException(ErrorException::ERROR_RULE_NOT_FOUND, "rule not found in cube", "cube", (int)cube->getId(), "rule", (int)(erule ? erule->nr_rule : NO_IDENTIFIER));
	}
}
开发者ID:abraneo,项目名称:jedox-mirror,代码行数:28,代码来源:LegacySource.cpp


示例6: ParameterException

void CubeDimension::changeElementName(PServer server, PDatabase db, Element * element, const string& name, PUser user, bool useJournal, bool useDimWorker)
{
	if (user) {
		throw ParameterException(ErrorException::ERROR_DIMENSION_UNCHANGABLE, "dimension is not changable", "user", (int)user->getId());
	}
	return SystemDimension::changeElementName(server, db, element, name, user, useJournal, useDimWorker);
}
开发者ID:abraneo,项目名称:jedox-mirror,代码行数:7,代码来源:CubeDimension.cpp


示例7: lock

void FlowManager::set_scheduler_type(const PortId port, const std::string type)
{
    std::unique_lock<std::mutex> lock(mutex_);
    if (port != DEFAULT_BELOW_PORT_ID)
        throw ParameterException("Defining a scheduler for given lower layer port is not supported at the moment.");

    schedulers_[port] = SchedulerFactory::make_scheduler(type);
}
开发者ID:andrepuschmann,项目名称:libgdtp,代码行数:8,代码来源:flow_manager.cpp


示例8: ParameterException

Value MethodCall::getParam(unsigned ind) const
{
  if (ind < params.size() )
    return params[ind];

  throw ParameterException(InvalidMethodParameterError,
                           "MethodCall::getParam: Parameter index " + toString(ind) + " in " + getSignature() + " method is out-of-range.");
}
开发者ID:MrMC,项目名称:ulxmlrpcpp,代码行数:8,代码来源:ulxr_call.cpp


示例9: ULXR_API_IMPL

ULXR_API_IMPL(Value) MethodCall::getParam(unsigned ind) const
{
  if (ind < params.size() )
    return params[ind];

  throw ParameterException(InvalidMethodParameterError,
                           ulxr_i18n(ULXR_PCHAR("Not enough actual parameters for call to method: ")
                               +getSignature()));
}
开发者ID:jeccey,项目名称:Core_Area,代码行数:9,代码来源:ulxr_call.cpp


示例10: ParameterException

//------------------------------------------------------------------------------
void BooleanWrapper::SetupWrapper()
{
   if (GmatStringUtil::ToBoolean(description, value) == false)
   {
      std::string errmsg = "For Boolean wrapper \"";
      errmsg += description;
      errmsg += "\", the description string does not evaluate to Boolean\n"; 
      throw ParameterException(errmsg);
   }
}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:11,代码来源:BooleanWrapper.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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