本文整理汇总了C++中NotFound函数的典型用法代码示例。如果您正苦于以下问题:C++ NotFound函数的具体用法?C++ NotFound怎么用?C++ NotFound使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NotFound函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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);
}
}
示例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);
}
}
示例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 );
}
示例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();
}
}
示例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));
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例12: select
Row Connection::selectRow(const std::string& query)
{
tntdb::Result result = select(query);
if (result.empty())
throw NotFound();
return result.getRow(0);
}
示例13: selectRow
Value Connection::selectValue(const std::string& query)
{
Row t = selectRow(query);
if (t.empty())
throw NotFound();
return t.getValue(0);
}
示例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 + ".");
}
示例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);
}
}