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


C++ MojRefCountedPtr类代码示例

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


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

示例1: Start

void Start(MockBusClient& busClient, MojRefCountedPtr<ActivitySet>& actSet)
{
	MockDoneSlot startSlot;
	actSet->StartActivities(startSlot.GetSlot());
	busClient.ProcessRequests();

	ASSERT_TRUE( startSlot.Called() );
}
开发者ID:hatsada1,项目名称:app-services,代码行数:8,代码来源:ActivitySetTest.cpp

示例2: MojAssert

MojErr MojDbQuotaEngine::initUsage(MojDbKind* kind, MojDbReq& req)
{
	MojAssert(kind);

	MojRefCountedPtr<MojDbStorageItem> item;
	MojErr err = m_usageDb->get(kind->id(), req.txn(), false, item);
	MojErrCheck(err);
	if (!item.get()) {
		MojObject stats;
		MojSize usage = 0;
		err = kind->stats(stats, usage, req, false);
		MojErrCheck(err);
		err = insertUsage(kind->id(), (MojInt64) usage, req.txn());
		MojErrCheck(err);
	}
	return MojErrNone;
}
开发者ID:anttiharju-owo,项目名称:db8,代码行数:17,代码来源:MojDbQuotaEngine.cpp

示例3: sendEcho

	MojErr sendEcho(const MojChar* json, const MojObject& expectedResponse, const MojChar* method)
	{
		MojRefCountedPtr<EchoResponseHdlr> handler(new EchoResponseHdlr(expectedResponse, ++m_pendingResponseCount));
		MojAllocCheck(handler.get());

		MojRefCountedPtr<MojServiceRequest> req;
		MojErr err = m_service.createRequest(req);
		MojTestErrCheck(err);

		MojObject payload;
		err = payload.fromJson(json);
		MojTestErrCheck(err);
		err = req->send(handler->m_slot, ServiceName, method, payload);
		MojTestErrCheck(err);

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

示例4: End

void End(MockBusClient& busClient, MojRefCountedPtr<ActivitySet>& actSet)
{
	MockDoneSlot endSlot;
	actSet->EndActivities(endSlot.GetSlot());
	busClient.ProcessRequests();

	ASSERT_TRUE( endSlot.Called() );
}
开发者ID:hatsada1,项目名称:app-services,代码行数:8,代码来源:ActivitySetTest.cpp

示例5: MojAssert

MojErr MojDbKindState::writeTokens(const MojObject& tokensObj)
{
	MojAssert(m_kindEngine);
	MojAssertMutexLocked(m_lock);

	MojDbStorageDatabase* db = m_kindEngine->kindDb();
	MojRefCountedPtr<MojDbStorageTxn> txn;
	MojErr err = db->beginTxn(txn);
	MojErrCheck(err);
	MojAssert(txn.get());
	err = writeObj(TokensKey, tokensObj, db, txn.get(), m_oldTokensItem);
	MojErrCheck(err);
	err = txn->commit();
	MojErrCheck(err);

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

示例6: readObj

MojErr MojDbKindState::readObj(const MojChar* key, MojObject& val, MojDbStorageDatabase* db,
		MojDbStorageTxn* txn, MojRefCountedPtr<MojDbStorageItem>& oldItem)
{
	MojAssert(key && db);

	MojErr err = db->get(m_kindId, txn, false, oldItem);
	MojErrCheck(err);
	if (oldItem.get()) {
		// get objects
		MojObject obj;

		// TODO: this bugging ( on calling getObj)
		err = oldItem->toObject(obj, *m_kindEngine, false);
		MojErrCheck(err);
		obj.get(key, val);
	}
	return MojErrNone;
}
开发者ID:feniksa,项目名称:indb8,代码行数:18,代码来源:MojDbKindState.cpp

示例7: getImpl

MojErr MojDb::getImpl(const MojObject& id, MojObjectVisitor& visitor, MojDbOp op, MojDbReq& req)
{
	MojRefCountedPtr<MojDbStorageItem> item;
	MojErr err = m_objDb->get(id, req.txn(), false, item);
	MojErrCheck(err);
	if (item.get()) {
		MojString kindId;
		err = item->kindId(kindId, m_kindEngine);
		MojErrCheck(err);
		err = m_kindEngine.checkPermission(kindId, op, req);
		MojErrCheck(err);
		err = item->visit(visitor, m_kindEngine);
		MojErrCheck(err);
		err = item->close();
		MojErrCheck(err);
	}
	return MojErrNone;
}
开发者ID:KyleMaas,项目名称:db8,代码行数:18,代码来源:MojDb.cpp

示例8: checkErrMap

MojErr MojDbTestStorageEngine::openSequence(const MojChar* name, MojDbStorageTxn* txn, MojRefCountedPtr<MojDbStorageSeq>& seqOut)
{
	MojErr err = checkErrMap(_T("engine.openSequence"));
	MojErrCheck(err);

	MojAssert(name && !seqOut.get());
	//open the actual storage sequence
	MojAssert(m_engine.get());
	MojRefCountedPtr<MojDbStorageSeq> realSeq;
	err = m_engine->openSequence(name, MojTestTxn(txn), realSeq);
	MojErrCheck(err);

	//create the test storage seq as a wrapper
	MojRefCountedPtr<MojDbTestStorageSeq> seq(new MojDbTestStorageSeq(realSeq.get(), this));
	MojAllocCheck(seq.get());
	seqOut = seq;

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

示例9: MojAssert

MojErr MojDbSandwichEngine::beginTxn(MojRefCountedPtr<MojDbStorageTxn>& txnOut)
{
    MojAssert(!txnOut.get());

    MojRefCountedPtr<MojDbSandwichEnvTxn> txn(new MojDbSandwichEnvTxn(m_db));
    MojAllocCheck(txn.get());
    txnOut = txn;

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

示例10: MojErrCheck

MojErr MojDbTestStorageIndex::find(MojAutoPtr<MojDbQueryPlan> plan, MojDbStorageTxn* txn, MojRefCountedPtr<MojDbStorageQuery>& queryOut)
{
	MojErr err = m_testEngine->checkErrMap(_T("index.find"));
	MojErrCheck(err);

	MojAssert(m_idx.get());
	MojAssert(plan.get());

	//create the real query
	MojRefCountedPtr<MojDbStorageQuery> realQuery;
	err = m_idx->find(plan, MojTestTxn(txn), realQuery);
	MojErrCheck(err);

	MojRefCountedPtr<MojDbTestStorageQuery> storageQuery(new MojDbTestStorageQuery(realQuery.get(), m_testEngine));
	MojAllocCheck(storageQuery.get());
	queryOut = storageQuery;

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

示例11: Connected

void ImapSession::Connected(const MojRefCountedPtr<SocketConnection>& connection)
{
	m_connection = connection;
	
	if(connection.get()) {
		m_inputStream = connection->GetInputStream();
		m_outputStream = connection->GetOutputStream();

		m_closedSlot.cancel(); // make sure it's not connected to a slot
		m_connection->WatchClosed(m_closedSlot);

		if(NeedLoginCapabilities()) {
			CheckLoginCapabilities();
		} else {
			LoginCapabilityComplete();
		}
	} else {
		CheckQueue();
	}
}
开发者ID:Garfonso,项目名称:app-services,代码行数:20,代码来源:ImapSession.cpp

示例12: LOG_TRACE

MojErr MojDbSandwichEngine::beginTxn(MojRefCountedPtr<MojDbStorageTxn>& txnOut)
{
    LOG_TRACE("Entering function %s", __FUNCTION__);
    MojAssert(!txnOut.get());

    MojRefCountedPtr<MojDbSandwichEnvTxn> txn(new MojDbSandwichEnvTxn(m_db));
    MojAllocCheck(txn.get());
    txnOut = txn;

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

示例13: 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

示例14: command

void ImapSession::DownloadPart(const MojObject& folderId, const MojObject& emailId, const MojObject& partId, const MojRefCountedPtr<DownloadListener>& listener, Command::Priority priority)
{
	MojRefCountedPtr<FetchPartCommand> command(new FetchPartCommand(*this, folderId, emailId, partId, priority));

	// Look for an active command
	MojRefCountedPtr<ImapCommand> activeCommand = FindActiveCommand(command);
	if(activeCommand.get()) {
		MojLogDebug(m_log, "attaching download request to existing active command");

		if(listener.get())
			static_cast<FetchPartCommand*>(activeCommand.get())->AddDownloadListener(listener);

		return;
	}

	// Look for a pending command with equal or higher priority
	// TODO: requeue if a higher priority is needed
	MojRefCountedPtr<ImapCommand> pendingCommand = FindPendingCommand(command);
	if(pendingCommand.get() && pendingCommand->GetPriority() >= priority) {
		MojLogDebug(m_log, "attaching download request to existing pending command");

		if(listener.get())
			static_cast<FetchPartCommand*>(pendingCommand.get())->AddDownloadListener(listener);

		// Poke the queue in case it's not already running
		CheckQueue();
		return;
	}

	// Otherwise, use the new command
	if(listener.get())
		command->AddDownloadListener(listener);

	// If this is a high priority request, set m_recentUserInteraction to true
	if (priority >= Command::HighPriority) {
		m_recentUserInteraction = true;
	}

	m_commandManager->QueueCommand(command, false);
	CheckQueue();
}
开发者ID:Garfonso,项目名称:app-services,代码行数:41,代码来源:ImapSession.cpp

示例15: LOG_TRACE

MojErr MojDbLunaServiceDb::openDb(MojDbEnv* env, const MojChar* dir, const MojObject& conf)
{
    LOG_TRACE("Entering function %s", __FUNCTION__);
    MojAssert(env && dir);

    MojErr err;
    //  MojRefCountedPtr<MojDbBerkeleyEngine> engine(new MojDbBerkeleyEngine);
    MojRefCountedPtr<MojDbStorageEngine> engine;
    MojDbStorageEngine::engineFactory()->create(engine);
    MojAllocCheck(engine.get());
    err = engine->configure(conf);
    MojErrCheck(err);
    err = engine->open(dir, env);
    MojErrCheck(err);

    // open db
    err = m_db.open(dir, engine.get());
    MojErrCheck(err);

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


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