当前位置: 首页>>代码示例>>C++>>正文


C++ MojDbReq::domain方法代码示例

本文整理汇总了C++中MojDbReq::domain方法的典型用法代码示例。如果您正苦于以下问题:C++ MojDbReq::domain方法的具体用法?C++ MojDbReq::domain怎么用?C++ MojDbReq::domain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MojDbReq的用法示例。


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

示例1: addWatch

MojErr MojDbIndex::addWatch(const MojDbQueryPlan& plan, MojDbCursor& cursor, MojDbWatcher* watcher, MojDbReq& req)
{
	MojAssert(watcher);
	MojLogTrace(s_log);

	// TODO: use interval tree instead of vector for watches
	MojThreadWriteGuard guard(m_lock);
	MojErr err = m_watcherVec.push(watcher);
	MojErrCheck(err);
	// update count map
	watcher->domain(req.domain());
	WatcherMap::Iterator iter;
	err = m_watcherMap.find(req.domain(), iter);
	MojErrCheck(err);
	if (iter == m_watcherMap.end()) {
		err = m_watcherMap.put(req.domain(), 1);
		MojErrCheck(err);
	} else {
		iter.value() += 1;
		if (iter.value() > WatchWarningThreshold) {
			MojLogWarning(s_log, _T("db:'%s' has %zd watches open on index '%s - %s'"),
					req.domain().data(), iter.value(), m_kind->id().data(), m_name.data());
		}
	}
	MojLogInfo(s_log, _T("DbIndex_addWatch - '%s' on index '%s - %s'"),
					req.domain().data(),  m_kind->id().data(), m_name.data());
	// drop lock before acquiring watcher mutex in init
	guard.unlock();
	watcher->init(this, plan.ranges(), plan.desc(), false);

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

示例2: objectPermission

MojDbPermissionEngine::Value MojDbKind::objectPermission(const MojChar* op, MojDbReq& req)
{
	MojDbPermissionEngine::Value val = m_kindEngine->permissionEngine()->
			check(PermissionType, m_id, req.domain(), op);
	if (val == MojDbPermissionEngine::ValueUndefined && !m_supers.empty()) {
		val = m_supers[0]->objectPermission(op, req);
	}
	return val;
}
开发者ID:webOS101,项目名称:db8,代码行数:9,代码来源:MojDbKind.cpp

示例3: deny

MojErr MojDbKind::deny(MojDbReq& req)
{
	MojLogWarning(s_log, _T("db: permission denied for caller '%s' on kind '%s'"), req.domain().data(), m_id.data());
	if (m_kindEngine->permissionEngine()->enabled()) {
		// don't leak any information in an error message
		MojErrThrow(MojErrDbPermissionDenied);
	}
	return MojErrNone;
}
开发者ID:webOS101,项目名称:db8,代码行数:9,代码来源:MojDbKind.cpp

示例4: addWatch

MojErr MojDbIndex::addWatch(const MojDbQueryPlan& plan, MojDbCursor& cursor, MojDbWatcher* watcher, MojDbReq& req)
{
    LOG_TRACE("Entering function %s", __FUNCTION__);
	MojAssert(watcher);

	// TODO: use interval tree instead of vector for watches
	MojThreadWriteGuard guard(m_lock);
	MojErr err = m_watcherVec.push(watcher);
	MojErrCheck(err);
	// update count map
	watcher->domain(req.domain());
	WatcherMap::Iterator iter;
	err = m_watcherMap.find(req.domain(), iter);
	MojErrCheck(err);
	if (iter == m_watcherMap.end()) {
		err = m_watcherMap.put(req.domain(), 1);
		MojErrCheck(err);
	} else {
		iter.value() += 1;
		if (iter.value() > WatchWarningThreshold) {
            LOG_WARNING(MSGID_MOJ_DB_INDEX_WARNING, 4,
            		PMLOGKS("domain", req.domain().data()),
            		PMLOGKFV("iter", "%zd", iter.value()),
            		PMLOGKS("kindId", m_kind->id().data()),
            		PMLOGKS("name", m_name.data()),
            		"db:'domain' has 'iter' watches open on index 'kindId - name'");
		}
	}
	LOG_DEBUG("[db_mojodb] DbIndex_addWatch - '%s' on index '%s - %s'",
		req.domain().data(),  m_kind->id().data(), m_name.data());
	// drop lock before acquiring watcher mutex in init
	guard.unlock();
	watcher->init(this, plan.ranges(), plan.desc(), false);

	return MojErrNone;
}
开发者ID:sailesharya,项目名称:db8,代码行数:36,代码来源:MojDbIndex.cpp

示例5: hasOwnerPermission

bool MojDbKind::hasOwnerPermission(MojDbReq& req)
{
	return (req.admin() || req.domain() == m_owner);
}
开发者ID:webOS101,项目名称:db8,代码行数:4,代码来源:MojDbKind.cpp


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