本文整理汇总了C++中Operation::isDefaultTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Operation::isDefaultTo方法的具体用法?C++ Operation::isDefaultTo怎么用?C++ Operation::isDefaultTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operation
的用法示例。
在下文中一共展示了Operation::isDefaultTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_external_op_puppet_nonexistant
void TrustedConnectionCreatorintegration::test_external_op_puppet_nonexistant()
{
// Dispatching a Talk external op from the creator, to the creator should
// result in it being passed directly to the normal op dispatch,
// shortcutting the world.
m_creator->m_externalMind = new ExternalMind(*m_creator);
m_creator->m_externalMind->linkUp(m_connection);
Entity * other = new Entity(compose("%1", m_id_counter), m_id_counter++);
other->setType(m_creatorType);
m_server->m_world.addEntity(other);
Atlas::Objects::Operation::Talk op;
op->setFrom(m_creator->getId());
op->setTo(compose("%1", m_id_counter++));
m_connection->externalOperation(op, *m_connection);
// Operation should be via world dispatch, as if it was from the Entity
// we are puppeting.
ASSERT_TRUE(m_Link_send_sent.isValid());
ASSERT_EQUAL(m_Link_send_sent->getParents().front(),
"unseen");
ASSERT_TRUE(!m_Link_send_sent->isDefaultTo());
ASSERT_EQUAL(m_Link_send_sent->getTo(), m_creator->getId());
}
示例2: test_external_op_puppet
void TrustedConnectionCreatorintegration::test_external_op_puppet()
{
// Dispatching a Talk external op from the creator, to the creator should
// result in it being passed directly to the normal op dispatch,
// shortcutting the world.
m_creator->m_externalMind = new ExternalMind(*m_creator);
m_creator->m_externalMind->linkUp(m_connection);
Entity * other = new Entity(compose("%1", m_id_counter), m_id_counter++);
other->setType(m_creatorType);
m_server->m_world.addEntity(other);
Atlas::Objects::Operation::Talk op;
op->setFrom(m_creator->getId());
op->setTo(other->getId());
m_connection->externalOperation(op, *m_connection);
// Operation should be via world dispatch, as if it was from the Entity
// we are puppeting.
ASSERT_TRUE(m_BaseWorld_message_called.isValid());
ASSERT_EQUAL(m_BaseWorld_message_called->getClassNo(),
Atlas::Objects::Operation::TALK_NO);
ASSERT_TRUE(!m_BaseWorld_message_called->isDefaultTo());
ASSERT_EQUAL(m_BaseWorld_message_called->getTo(), other->getId());
ASSERT_NOT_NULL(m_BaseWorld_message_called_from);
ASSERT_EQUAL(m_BaseWorld_message_called_from, other);
}
示例3: test_external_op
void ConnectionCharacterintegration::test_external_op()
{
// Dispatching a Talk external op from the character should result in
// it being passed on to the world.
m_character->linkExternal(m_connection);
Atlas::Objects::Operation::Talk op;
op->setFrom(m_character->getId());
m_connection->externalOperation(op, *m_connection);
// BaseWorld::message should have been called from Enitty::sendWorld
// with the Talk operation, modified to have TO set to the character.
ASSERT_TRUE(m_BaseWorld_message_called.isValid());
ASSERT_EQUAL(m_BaseWorld_message_called->getClassNo(),
Atlas::Objects::Operation::TALK_NO);
ASSERT_TRUE(!m_BaseWorld_message_called->isDefaultTo());
ASSERT_EQUAL(m_BaseWorld_message_called->getTo(), m_character->getId());
ASSERT_NOT_NULL(m_BaseWorld_message_called_from);
ASSERT_EQUAL(m_BaseWorld_message_called_from, m_character);
}
示例4: test_external_op_override
void TrustedConnectionCreatorintegration::test_external_op_override()
{
// Dispatching a Talk external op from the creator should result in
// it being passed on to the world, exactly as if this was a Character
// except that we assume that Creator was set up linked.
m_creator->m_externalMind = new ExternalMind(*m_creator);
m_creator->m_externalMind->linkUp(m_connection);
Atlas::Objects::Operation::Talk op;
op->setFrom(m_creator->getId());
op->setTo(m_creator->getId());
m_connection->externalOperation(op, *m_connection);
// The operation should have been passed to Entity::callOperation for
// dispatch, completely unfiltered.
ASSERT_TRUE(m_Entity_callOperation_called.isValid());
ASSERT_EQUAL(m_Entity_callOperation_called->getClassNo(),
Atlas::Objects::Operation::TALK_NO);
ASSERT_TRUE(!m_Entity_callOperation_called->isDefaultTo());
ASSERT_EQUAL(m_Entity_callOperation_called->getTo(), m_creator->getId());
}