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

C++ MojErrCheck函数代码示例

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

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



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

示例1: MojAssert

MojErr MojDbServiceHandler::handleDelKind(MojServiceMessage* msg, MojObject& payload, MojDbReq& req)
{
	MojAssert(msg);
	MojLogTrace(s_log);

	MojObject id;
	MojErr err = payload.getRequired(MojDbServiceDefs::IdKey, id);
	MojErrCheck(err);
	
	bool found = false;
	err = m_db.delKind(id, found, MojDb::FlagNone, req);
	MojErrCheck(err);

    if (!found)
    	MojErrThrow(MojErrDbKindNotRegistered);
	err = msg->replySuccess();
	MojErrCheck(err);

	return MojErrNone;
}
开发者ID:anttiharju-owo,项目名称:db8,代码行数:20,代码来源:MojDbServiceHandler.cpp


示例2: LOG_TRACE

MojErr MojDbMultiExtractor::vals(const MojObject& obj, KeySet& valsOut) const
{
    LOG_TRACE("Entering function %s", __FUNCTION__);

	// extract property values
	for (ExtractorVec::ConstIterator i = m_extractors.begin(); i != m_extractors.end(); ++i) {
		MojErr err = (*i)->vals(obj, valsOut);
		MojErrCheck(err);
	}
	return MojErrNone;
}
开发者ID:ctbrowser,项目名称:db8,代码行数:11,代码来源:MojDbExtractor.cpp


示例3: MojAssert

MojErr MojService::addRequest(MojServiceRequest* req)
{
	MojAssert(req);
	MojAssertMutexLocked(m_mutex);
	MojLogTrace(s_log);

	MojErr err = m_requests.put(req->token(), req);
	MojErrCheck(err);

	return MojErrNone;
}
开发者ID:BigBlueHat,项目名称:db8,代码行数:11,代码来源:MojService.cpp


示例4: MojAssert

MojErr MojDbKindState::indexId(const MojChar* indexName, MojDbReq& req, MojObject& idOut, bool& createdOut)
{
	MojAssert(indexName);

	MojThreadGuard guard(m_lock);

	MojErr err = id(indexName, IndexIdsKey, req, idOut, createdOut);
	MojErrCheck(err);

	return MojErrNone;
}
开发者ID:BigBlueHat,项目名称:db8,代码行数:11,代码来源:MojDbKindState.cpp


示例5: MojErrCheck

MojErr MojDbKind::updateIndexes(const MojObject* newObj, const MojObject* oldObj, const MojDbReq& req, MojDbOp op, MojVector<MojDbKind*>& kindVec, MojInt32& idxcount)
{
	MojErr err = kindVec.push(this);
	MojErrCheck(err);

	// update supers
	for (KindVec::ConstIterator i = m_supers.begin();
		 i != m_supers.end(); ++i) {
		if (kindVec.find((*i), 0) == MojInvalidIndex) {
			err = (*i)->updateIndexes(newObj, oldObj, req, op, kindVec, idxcount);
			MojErrCheck(err);
		} else {
			return MojErrNone;
		}
	}
	err = updateOwnIndexes(newObj, oldObj, req, idxcount);
	MojErrCheck(err);

	return MojErrNone;
}
开发者ID:webOS101,项目名称:db8,代码行数:20,代码来源:MojDbKind.cpp


示例6: MojLogTrace

MojErr MojDbKind::clearSupers()
{
	MojLogTrace(s_log);

	// remove old supers
	MojErr err = MojErrNone;
	for (KindVec::ConstIterator i = m_supers.begin(); i != m_supers.end(); ++i) {
		err = (*i)->removeKind((*i)->m_subs, this);
		MojErrCheck(err);
	}
	m_supers.clear();
	// remove old subs
	for (KindVec::ConstIterator i = m_subs.begin(); i != m_subs.end(); ++i) {
		err = (*i)->removeKind((*i)->m_supers, this);
		MojErrCheck(err);
	}
	m_subs.clear();

	return MojErrNone;
}
开发者ID:webOS101,项目名称:db8,代码行数:20,代码来源:MojDbKind.cpp


示例7: deny

MojErr MojDbKind::checkPermission(MojDbOp op, MojDbReq& req)
{
	// if this request has admin privileges, skip the permissions check
	if (hasOwnerPermission(req))
		return MojErrNone;

	if (op == OpKindUpdate) {
		MojErr err = deny(req);
		MojErrCheck(err);
	} else {
		// check if permissions are set on this kind
		const MojChar* opStr = stringFromOperation(op);
		MojDbPermissionEngine::Value val = objectPermission(opStr, req);
		if (val != MojDbPermissionEngine::ValueAllow) {
			MojErr err = deny(req);
			MojErrCheck(err);
		}
	}
	return MojErrNone;
}
开发者ID:webOS101,项目名称:db8,代码行数:20,代码来源:MojDbKind.cpp


示例8: MojAssert

MojErr MojServiceMessage::handleCancel()
{
	MojAssert(m_service);
	if (m_subscribed) {
		MojErr err = m_service->removeSubscription(this);
		MojErrCheck(err);
		m_subscribed = false;
	}

	return MojErrNone;
}
开发者ID:ctbrowser,项目名称:db8,代码行数:11,代码来源:MojServiceMessage.cpp


示例9: MojAssert

MojErr MojDb::drop(const MojChar* path)
{
	MojAssert(path);
	MojLogTrace(s_log);

	MojErr err = requireOpen();
	MojErrCheck(err);

	MojDbReq req;
	err = req.begin(this, true);
	MojErrCheck(err);
	err = m_storageEngine->drop(path, req.txn());
	MojErrCheck(err);
	err = req.end();
	MojErrCheck(err);
	err = close();
	MojErrCheck(err);

	return MojErrNone;
}
开发者ID:KyleMaas,项目名称:db8,代码行数:20,代码来源:MojDb.cpp


示例10: LOG_TRACE

MojErr MojDbSearchCursor::count(MojUInt32& countOut)
{
    LOG_TRACE("Entering function %s", __FUNCTION__);

    countOut = 0;
    MojErr err = begin();
    MojErrCheck(err);
    countOut = m_count;

    return MojErrNone;
}
开发者ID:pombredanne,项目名称:db8,代码行数:11,代码来源:MojDbSearchCursor.cpp


示例11: MojAssert

MojErr MojObjectFilter::intValue(MojInt64 val)
{
	MojAssert(m_visitor);

	if (m_state.m_includeCount) {
		m_state.m_includeCount--;
		MojErr err = m_visitor->intValue(val);
		MojErrCheck(err);
	}
	return MojErrNone;
}
开发者ID:ctbrowser,项目名称:db8,代码行数:11,代码来源:MojObjectFilter.cpp


示例12: MojErrCheck

MojErr MojDbTestStorageDatabase::openIndex(const MojObject& id, MojDbStorageTxn* txn, MojRefCountedPtr<MojDbStorageIndex>& indexOut)
{
	MojErr err = m_testEngine->checkErrMap(_T("db.openIndex"));
	MojErrCheck(err);

	MojAssert(m_db.get());
	MojAssert(!indexOut.get());

	//open the actual storage index
	MojRefCountedPtr<MojDbStorageIndex> realIdx;
	err = m_db->openIndex(id, MojTestTxn(txn), realIdx);
	MojErrCheck(err);

	//create the test storage index as a wrapper
	MojRefCountedPtr<MojDbTestStorageIndex> index(new MojDbTestStorageIndex(realIdx.get(), m_testEngine));
	MojAllocCheck(index.get());
	indexOut = index;

	return MojErrNone;
}
开发者ID:feniksa,项目名称:indb8,代码行数:20,代码来源:MojDbTestStorageEngine.cpp


示例13: getKey

MojErr MojDbLevelQuery::seekImpl(const ByteVec& key, bool desc, bool& foundOut)
{
	if (key.empty()) {
		// if key is empty, seek to beginning (or end if desc)
		MojErr err = getKey(foundOut, SeekEmptyFlags[desc]);
		MojErrCheck(err);
	} else {
		// otherwise seek to the key
		MojErr err = m_key.fromBytes(key.begin(), key.size());
		MojErrCheck(err);
		err = getKey(foundOut, SeekFlags);
		MojErrCheck(err);
		// if descending, skip the first result (which is outside the range)
		if (desc) {
			err = next(foundOut);
			MojErrCheck(err);
		}
	}
	return MojErrNone;
}
开发者ID:BigBlueHat,项目名称:db8,代码行数:20,代码来源:MojDbLevelQuery.cpp


示例14: MojLogTrace

MojErr MojDb::delImpl(const MojObject& id, bool& foundOut, MojObject& foundObjOut, MojDbReq& req, MojUInt32 flags)
{
	MojLogTrace(s_log);

	foundObjOut.clear();
	// get object, so we can find the type
	MojRefCountedPtr<MojDbStorageItem> item;
	MojErr err = m_objDb->get(id, req.txn(), true, item);
	MojErrCheck(err);
	if (item.get()) {
		// and delete it
		MojObject obj;
		err = item->toObject(obj, m_kindEngine);
		MojErrCheck(err);
		err = delObj(id, obj, item.get(), foundObjOut, req, flags);
		MojErrCheck(err);
		foundOut = true;
	}
	return MojErrNone;
}
开发者ID:KyleMaas,项目名称:db8,代码行数:20,代码来源:MojDb.cpp


示例15: MojErrCheck

MojErr MojDbTextUtils::strToUnicode(const MojString& src, UnicodeVec& destOut)
{
	MojErr err = destOut.resize(src.length() * 2);
	MojErrCheck(err);
	MojInt32 destCapacity = 0;
	MojInt32 destLength = 0;
	do {
		UChar* dest = NULL;
		err = destOut.begin(dest);
		MojErrCheck(err);
		destCapacity = (MojInt32) destOut.size();
		UErrorCode status = U_ZERO_ERROR;
		u_strFromUTF8(dest, destCapacity, &destLength, src.data(), (MojInt32) src.length(), &status);
		if (status != U_BUFFER_OVERFLOW_ERROR)
			MojUnicodeErrCheck(status);
		err = destOut.resize(destLength);
		MojErrCheck(err);
	} while (destLength > destCapacity);

	return MojErrNone;
}
开发者ID:KyleMaas,项目名称:db8,代码行数:21,代码来源:MojDbTextUtils.cpp


示例16: consolidate

MojErr MojBuffer::release(MojAutoPtr<Chunk>& chunkOut)
{
	MojErr err = consolidate();
	MojErrCheck(err);
	MojAssert(m_chunks.size() <= 1);
	if (m_chunks.empty()) {
		chunkOut.reset();
	} else {
		chunkOut.reset(m_chunks.popFront());
	}
	return MojErrNone;
}
开发者ID:feniksa,项目名称:indb8,代码行数:12,代码来源:MojBuffer.cpp


示例17: header

MojErr MojSocketMessageEncoder::writeToBuffer(MojDataWriter& writer)
{
	// initialize header
	MojSocketMessageHeader header(m_msg);
	if (header.messageLen() > MojSocketMessageHeader::s_maxMsgSize) {
		MojErrThrow(MojErrInvalidMsg);
	}

	// reserve buffer space
	MojSize reserve = header.messageLen() + sizeof(header);
	MojErr err = writer.reserve(reserve);
	MojErrCheck(err);

	// write header and message to buffer
	err = header.write(writer);
	MojErrCheck(err);
	err = m_msg.serialize(writer);
	MojErrCheck(err);

	return MojErrNone;
}
开发者ID:KyleMaas,项目名称:db8,代码行数:21,代码来源:MojSocketEncoding.cpp


示例18: LOG_AM_DEBUG

MojErr ActivityManagerApp::ready()
{
	LOG_AM_DEBUG("%s ready to accept incoming requests",
		name().data());

	/* All stored Activities have been deserialized from the database.  All
	 * previously persisted Activity IDs are marked as used.  It's safe to
	 * accept requests.  Bring up the Service side interface! */
	MojErr err = online();
	MojErrCheck(err);

	/* Activity Manager prepared to accept requests at this point, but not
	 * to allow Activities to move into the scheduled state where their
	 * outcalls are made. */

#ifndef WEBOS_TARGET_MACHINE_IMPL_SIMULATOR
	/* Engage the Luna Bus Proxy, start mapping services */
	m_busProxy->Enable();
#endif

	/* Start up the various requirement management proxy connections now,
	 * so they don't start a storm of requests once the UI is up. */
	m_requirementManager->Enable();

	/* Subscribe to timezone notifications. */
	m_scheduler->Enable();

#if !defined(WEBOS_TARGET_MACHINE_IMPL_SIMULATOR)
	char *upstart_job = getenv("UPSTART_JOB");
	if (upstart_job) {
		char *upstart_event = g_strdup_printf("/sbin/initctl emit %s-ready",
			upstart_job);
		if (upstart_event) {
			int retVal = ::system(upstart_event);
			if (retVal == -1) {
				LOG_AM_ERROR(MSGID_UPSTART_EMIT_FAIL,0,
					"ServiceApp: Failed to emit upstart event");
			}
			g_free(upstart_event);
		} else {
			LOG_AM_ERROR(MSGID_UPSTART_EMIT_ALLOC_FAIL,0,
				"ServiceApp: Failed to allocate memory for upstart emit");
		}
	}
#endif

#if defined(WEBOS_TARGET_MACHINE_IMPL_SIMULATOR)
	/* SystemManagerProxy not instantiated, so mark the UI as enabled */
	m_am->Enable(ActivityManager::UI_ENABLE);
#endif

    return MojErrNone;
}
开发者ID:ctbrowser,项目名称:activitymanager,代码行数:53,代码来源:ServiceApp.cpp


示例19: MojPrintF

MojErr MojPrintF(const MojChar* format, ...)
{
	MojAssert(format);

	va_list args;
	va_start (args, format);
	MojErr err = MojVPrintF(format, args);
	va_end(args);
	MojErrCheck(err);

	return MojErrNone;
}
开发者ID:BigBlueHat,项目名称:db8,代码行数:12,代码来源:MojOs.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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