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

C++ NotFound函数代码示例

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

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



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

示例1: NotFound

ItemDB::Record ItemDB::getByDisplayId(unsigned int id)
{
	if (!inited) {
		int j=0;
		for(Iterator i=begin(); i!=end(); ++i)
		{
			itemLookup[i->getUInt(ID)] = j;
			itemDisplayLookup[i->getUInt(ItemDisplayInfo)] = j;
			j++;
		}
		inited = true;
	}

    if (itemDisplayLookup.find(id)!=itemDisplayLookup.end()) {
		int i = itemDisplayLookup[id];
		ItemDB::Record rec = itemdb.getRecord(i);
		return rec;
    }
	throw NotFound();

/*
	for(Iterator i=begin(); i!=end(); ++i)
	{
		if (i->getUInt(ItemDisplayInfo)==id)
			return (*i);
	}
	//wxLogMessage(wxT("NotFound: %s:%s#%d id:%d"), __FILE__, __FUNCTION__, __LINE__, id);
*/
	throw NotFound();
}
开发者ID:SamBao,项目名称:wowmodelviewer,代码行数:30,代码来源:database.cpp


示例2: store

/**
 * \brief Get the tracking history of a specific guide run
 *
 * Note that the result of this operation can be large. A guide run of an
 * hour with 5 updates per second (using an adaptive optics unit) contains
 * 18000 data points. Normal guide runs with 10 second update intervals
 * are quite manageable in size, about 360 points per hour of guiding.
 */
TrackingHistory	GuiderFactoryI::getTrackingHistory(int id,
			const Ice::Current& /* current */) {
	astro::guiding::TrackingStore	store(database);
	TrackingHistory	history;
	history.guiderunid = id;

	// get other attributes
	try {
		astro::guiding::GuidingRunTable	gt(database);
		astro::guiding::GuidingRunRecord	r = gt.byid(id);
		history.timeago = converttime(r.whenstarted);
		history.guider.cameraname = r.camera;
		history.guider.ccdid = r.ccdid;
		history.guider.guiderportname = r.guiderport;

		// tracking points
		astro::guiding::TrackingStore	store(database);
		std::list<astro::guiding::TrackingPointRecord>	points
			= store.getHistory(id);
		std::list<astro::guiding::TrackingPointRecord>::iterator i;
		for (i = points.begin(); i != points.end(); i++) {
			history.points.push_back(convert(*i));
		}

		// done
		return history;
	} catch (const std::exception& ex) {
		std::string	msg = astro::stringprintf("tracking history %d "
			"not found: %s", id, ex.what());
		debug(LOG_ERR, DEBUG_LOG, 0, "%s", msg.c_str());
		throw NotFound(msg);
	}
}
开发者ID:felipebetancur,项目名称:AstroPhotography-2,代码行数:41,代码来源:GuiderFactoryI.cpp


示例3: ct

/**
 * \brief get details about a specific calibration
 */
Calibration	GuiderFactoryI::getCalibration(int id,
			const Ice::Current& /* current */) {
	// use the database to retrieve the complete calibration data
	Calibration	calibration;
	try {
		astro::guiding::CalibrationTable	ct(database);
		astro::guiding::CalibrationRecord	r = ct.byid(id);
		calibration.id = r.id();
		calibration.timeago = converttime(r.when);
		calibration.guider.cameraname = r.camera;
		calibration.guider.ccdid = r.ccdid;
		calibration.guider.guiderportname = r.guiderport;
		for (int i = 0; i < 6; i++) {
			calibration.coefficients.push_back(r.a[i]);
		}

		// add calibration points
		astro::guiding::CalibrationStore	store(database);
		std::list<astro::guiding::CalibrationPointRecord>	points
			= store.getCalibrationPoints(id);
		std::list<astro::guiding::CalibrationPointRecord>::iterator i;
		for (i = points.begin(); i != points.end(); i++) {
			calibration.points.push_back(convert(*i));
		}
		return calibration;
	} catch (std::exception& ex) {
		std::string	msg = astro::stringprintf("calibrationd run %d "
			"not found: %s", id, ex.what());
		debug(LOG_ERR, DEBUG_LOG, 0, "%s", msg.c_str());
		throw NotFound(msg);
	}
}
开发者ID:felipebetancur,项目名称:AstroPhotography-2,代码行数:35,代码来源:GuiderFactoryI.cpp


示例4: InitFromClass

static void InitFromClass( at_waypoint_t *self, hobj_t *cls )
{
	hpair_t		*pair;
	hobj_t		*pref;

	__named_message( "\n" );

	strncpy( self->ati.type, cls->type, ATI_STRINGSIZE );
	strncpy( self->ati.name, cls->name, ATI_STRINGSIZE );
	self->ati.type[ATI_STRINGSIZE-1] = '\0';
	self->ati.name[ATI_STRINGSIZE-1] = '\0';


	pref = FindClass( at_prefs, cls->type );

	pair = FindHPair( cls, "origin" );
	if( pair )
	{
		HPairCastToVec3d( self->origin, pair );
	} else
		NotFound( "origin" );
	

	L_InsertWaypoint( self );
}
开发者ID:3dyne,项目名称:3dyne_legacy_engine,代码行数:25,代码来源:at_waypoint.cpp


示例5: getHash

std::string HashTableDb::get(const std::string& key)
{
	size_t hashCode = getHash(key) & hashMask;
	try
	{
		IndexNode node = ht->get(hashCode, key.c_str());
		DbRecord rec = node.getRecord(*db);
		if (rec.type() == Long)
		{
			std::string value = rec.value();
			while (rec.hasNextExtendedRecord())
			{
				rec = rec.nextExtendedRecord();
				value += rec.value();
			}
			return value;
		}
		else
		{
			return rec.value();
		}
	}
	catch (IndexFile::IndexNotFound)
	{
		throw NotFound();
	}
}
开发者ID:ComMouse,项目名称:SE106-Answers,代码行数:27,代码来源:HashTableDb.cpp


示例6: NotFound

/**
 * \brief Get the simulated CCD
 *
 * The simulator camera only implements a single ccd.
 */
CcdPtr	SimCamera::getCcd0(size_t ccdid) {
	if (0 != ccdid) {
		throw NotFound("only ccd 0 exists");
	}
	CcdInfo	info = getCcdInfo(0);
	return CcdPtr(new SimCcd(info, _locator));
}
开发者ID:felipebetancur,项目名称:AstroPhotography-2,代码行数:12,代码来源:SimCamera.cpp


示例7: i

void CompartmentSpaceVectorImpl::release_species(const Species& sp)
{
    species_map_type::iterator i(index_map_.find(sp));
    if (i == index_map_.end())
    {
        std::ostringstream message;
        message << "Speices [" << sp.serial() << "] not found";
        throw NotFound(message.str()); // use boost::format if it's allowed
    }

    species_map_type::mapped_type
        idx((*i).second), last_idx(num_molecules_.size() - 1);
    if (idx != last_idx)
    {
        species_container_type::size_type const
            idx_(static_cast<species_container_type::size_type>(idx)),
            last_idx_(static_cast<species_container_type::size_type>(last_idx));
        const Species& last_sp(species_[last_idx_]);
        species_[idx_] = last_sp;
        num_molecules_[idx] = num_molecules_[last_idx];
        index_map_[last_sp] = idx;
    }

    species_.pop_back();
    num_molecules_.pop_back();
    index_map_.erase(sp);
}
开发者ID:greatlse,项目名称:ecell4,代码行数:27,代码来源:CompartmentSpace.cpp


示例8: EmptyList

int CustomerList::FindCustomerLocation (QString userName)
{
	Node<Customer> * traversePtr;

	if(isEmpty())
	{
		throw EmptyList();
	}

	// NEED TO MAKE SURE 2 ACCOUNT NUMBERS CANNOT BE THE SAME //
	traversePtr = _head;
	int index = 0;
	while (index < Size() && traversePtr !=NULL &&
		   traversePtr->GetData().getUserName() != userName)
	{
		traversePtr = traversePtr->GetNext();

		index++;
	}
	if (traversePtr == NULL)
	{
		qDebug() << "12";
		// throw exception class if not found.
		throw NotFound();
	}

	return index;
}
开发者ID:AustinVaday,项目名称:CS1C-Class-Project,代码行数:28,代码来源:customerlistclass.cpp


示例9: findBranch

void Urls::Impl::handleUrlChanged(const std::string& path) {
    UrlTreeBranch* branch = findBranch(path);
    // If we didn't find any branches to handle the request, this is a bad url
    if (branch == nullptr)
        throw NotFound(path);
    branch->onSelected(path);
}
开发者ID:geolffrey,项目名称:footprint,代码行数:7,代码来源:Urls_impl.cpp


示例10: get

 /*! @throws NotFound */
 const std::string&
 get (const std::string& key) const
 {
     param_map_t::const_iterator i = params_.find(key);
     if (i == params_.end()) throw NotFound();
     return i->second;
 }
开发者ID:YannNayn,项目名称:galera-msvc,代码行数:8,代码来源:gu_config.hpp


示例11: NotFound

	const RawDataDAT1::s_info& DAT1::getInfo(const std::string& name) const {
		type_filelist::const_iterator i = m_filelist.find(name);
		if (i == m_filelist.end())
			throw NotFound(name);

		return i->second;
	}
开发者ID:karottenreibe,项目名称:FIFE,代码行数:7,代码来源:dat1.cpp


示例12: select

    Row Connection::selectRow(const std::string& query)
    {
      tntdb::Result result = select(query);
      if (result.empty())
        throw NotFound();

      return result.getRow(0);
    }
开发者ID:deniskin82,项目名称:tntdb,代码行数:8,代码来源:connection.cpp


示例13: selectRow

    Value Connection::selectValue(const std::string& query)
    {
      Row t = selectRow(query);
      if (t.empty())
        throw NotFound();

      return t.getValue(0);
    }
开发者ID:deniskin82,项目名称:tntdb,代码行数:8,代码来源:connection.cpp


示例14: NotFound

	Map* Model::getMap(const std::string& identifier) const {
		std::list<Map*>::const_iterator it = m_maps.begin();
		for(; it != m_maps.end(); ++it) {
			if((*it)->getId() == identifier)
				return *it;
		}

		throw NotFound(std::string("Tried to get non-existent map: ") + identifier + ".");
	}
开发者ID:Creepinevil,项目名称:fifengine,代码行数:9,代码来源:model.cpp


示例15: debug

TaskParameters TaskQueueI::parameters(int taskid, const Ice::Current& /* current */) {
	debug(LOG_DEBUG, DEBUG_LOG, 0, "query parameters of task %d", taskid);
	if (!taskqueue.exists(taskid)) {
		std::string	cause = astro::stringprintf(
			"task %d does not exist", taskid);
		debug(LOG_ERR, DEBUG_LOG, 0, "%s", cause.c_str());
		throw NotFound(cause);
	}
	try {
		return snowstar::convert(taskqueue.parameters(taskid));
	} catch (const std::exception& x) {
		std::string	 cause = astro::stringprintf(
			"cannot get parameters for task %d: %s %s", taskid,
			astro::demangle(typeid(x).name()).c_str(), x.what());
		debug(LOG_ERR, DEBUG_LOG, 0, "%s", cause.c_str());
		throw NotFound(cause);
	}
}
开发者ID:AndreasFMueller,项目名称:AstroPhotography,代码行数:18,代码来源:TaskQueueI.cpp


示例16: debug

FocuserPtr	SimLocator::getFocuser0(const DeviceName& name) {
	std::string	sname = name;
	if (sname != "focuser:simulator/focuser") {
		debug(LOG_ERR, DEBUG_LOG, 0, "focuser %s does not exist",
			sname.c_str());
		throw NotFound("no such focuser");
	}
	return _focuser;
}
开发者ID:AndreasFMueller,项目名称:AstroPhotography,代码行数:9,代码来源:SimLocator.cpp


示例17: FL_DBG

	RawData* VFS::open(const std::string& path) {
		FL_DBG(_log, LMsg("Opening: ") << path);

		VFSSource* source = getSourceForFile(path);
		if (!source)
			throw NotFound(path);

		return source->open(path);
	}
开发者ID:fifengine,项目名称:fifengine,代码行数:9,代码来源:vfs.cpp


示例18: NotFound

	Layer* Map::getLayer(const std::string& id) {
		std::list<Layer*>::const_iterator it = m_layers.begin();
		for(; it != m_layers.end(); ++it) {
			if((*it)->getId() == id)
				return *it;
		}

		throw NotFound(id);
	}
开发者ID:karottenreibe,项目名称:FIFE,代码行数:9,代码来源:map.cpp


示例19: find_particle_id

 const ParticleID find_particle_id(const coordinate_type& coord) const
 {
     container_type::const_iterator i(this->find(coord));
     if (i == voxels_.end())
     {
         throw NotFound("No corresponding ParticleID was found.");
     }
     return (*i).second;
 }
开发者ID:kozo2,项目名称:ecell4,代码行数:9,代码来源:MolecularTypeBase.hpp


示例20: log_debug

    Value Connection::selectValue(const std::string& query)
    {
      log_debug("selectValue(\"" << query << "\")");
      Row t = selectRow(query);
      if (t.empty())
        throw NotFound();

      return t.getValue(0);
    }
开发者ID:AndreasWelchlin,项目名称:tntdb,代码行数:9,代码来源:connection.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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