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


C++ Name::empty方法代码示例

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


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

示例1:

inline size_t
calculateSkip(const Name& name,
              const Name& hint, const Name& zone)
{
  size_t skip = 0;

  if (!hint.empty()) {
    // These are only asserts. The caller should supply the right parameters
    skip = hint.size() + 1 + zone.size();
    BOOST_ASSERT(name.size() > skip);

    BOOST_ASSERT(name.getPrefix(hint.size()) == hint);
    BOOST_ASSERT(name.get(hint.size()) == FORWARDING_HINT_LABEL);
    BOOST_ASSERT(name.getSubName(hint.size() + 1, zone.size()) == zone);

  }
  else {
    skip = zone.size();
    BOOST_ASSERT(name.size() > skip);
    BOOST_ASSERT(name.getPrefix(zone.size()) == zone);
  }

  BOOST_ASSERT(name.get(skip) == NDNS_ITERATIVE_QUERY ||
               name.get(skip) == NDNS_CERT_QUERY);

  ++skip;
  return skip;
}
开发者ID:cawka,项目名称:ndns,代码行数:28,代码来源:ndns-label.cpp

示例2: makeAbsolute

	Name Name::makeAbsolute(const Name& name) const{
		assert(isAbsolute());
		assert(!name.empty());
		if(name.isAbsolute()) {
			return name.copy();
		} else {
			return concat(name);
		}
	}
开发者ID:PuerkitoBio,项目名称:locic,代码行数:9,代码来源:Name.cpp

示例3: getDefaultCertificateNameForIdentity

void
SecPublicInfo::refreshDefaultCertificate()
{
  Name certName = getDefaultCertificateNameForIdentity(getDefaultIdentity());
  if(certName.empty())
    defaultCertificate_.reset();
  else
    defaultCertificate_ = getCertificate(certName);
}
开发者ID:ltr120,项目名称:ndn-cpp,代码行数:9,代码来源:sec-public-info.hpp

示例4: Name

inline void
CommandInterestGenerator::generate(Interest& interest,
                                   const Name& certificateName /*= Name()*/)
{
  if (certificateName.empty())
    m_keyChain.sign(interest);
  else
    m_keyChain.sign(interest,
                    security::SigningInfo(security::SigningInfo::SIGNER_TYPE_CERT,
                                          certificateName));
}
开发者ID:2nd-ndn-hackathon,项目名称:ndn-cxx-logging,代码行数:11,代码来源:command-interest-generator.hpp

示例5: old

View::View(Name name) : 
	current(&layout),
    old(&layout),
	Q(&layout,&current),
	dgserver(0),
	locks(0),
	allowAnOpen(false) {
	if(name.empty())
		name = randomName('v');
	gd<Name>(&layout) = name;
	g_views[name] = this;
}
开发者ID:aosm,项目名称:graphviz,代码行数:12,代码来源:View.cpp

示例6: performSearch

		SearchResult performSearch(Context& context, const Name& name, const size_t searchStartPosition) {
			assert(!name.empty());
			
			const auto& scopeStack = context.scopeStack();
			
			const size_t startPosition = name.isAbsolute() ? scopeStack.size() - 1 : searchStartPosition;
			for (size_t i = startPosition; i < scopeStack.size(); i++) {
				const auto pos = scopeStack.size() - i - 1;
				const auto result = performInnerSearch(scopeStack[pos], name);
				if (!result.isNone()) return result;
			}
			
			return SearchResult::None();
		}
开发者ID:scrossuk,项目名称:locic,代码行数:14,代码来源:NameSearch.cpp

示例7: interest

void
SimpleDataRetrieval::sendInterest()
{
  Name prefix;
  m_context->getContextOption(PREFIX, prefix);
  
  Name suffix;
  m_context->getContextOption(SUFFIX, suffix);
  
  if (!suffix.empty())
  {
    prefix.append(suffix);
  }

  Interest interest(prefix);
  
  int interestLifetime = 0;
  m_context->getContextOption(INTEREST_LIFETIME, interestLifetime);
  interest.setInterestLifetime(time::milliseconds(interestLifetime));
  
  SelectorHelper::applySelectors(interest, m_context);
  
  ConsumerInterestCallback onInterestToLeaveContext = EMPTY_CALLBACK;
  m_context->getContextOption(INTEREST_LEAVE_CNTX, onInterestToLeaveContext);
  if (onInterestToLeaveContext != EMPTY_CALLBACK)
  {
    onInterestToLeaveContext(*dynamic_cast<Consumer*>(m_context), interest);
  }
  
  m_face->expressInterest(interest,
                          bind(&SimpleDataRetrieval::onData, this, _1, _2),
                          bind(&SimpleDataRetrieval::onTimeout, this, _1));
  
  bool isAsync = false;
  m_context->getContextOption(ASYNC_MODE, isAsync);
  
  if (!isAsync)
  {
    m_face->processEvents();
  }
}
开发者ID:jdlee6461,项目名称:Consumer-Producer-API,代码行数:41,代码来源:simple-data-retrieval.cpp

示例8: addIdentity

int64_t
PibDb::addKey(const Name& keyName, const PublicKey& key)
{
  if (keyName.empty())
    return 0;

  Name&& identity = keyName.getPrefix(-1);
  if (!hasIdentity(identity))
    addIdentity(identity);

  sqlite3_stmt* statement;
  sqlite3_prepare_v2(m_database,
                     "INSERT INTO keys (identity_id, key_name, key_type, key_bits) \
                      values ((SELECT id FROM identities WHERE identity=?), ?, ?, ?)",
                     -1, &statement, nullptr);
  sqlite3_bind_block(statement, 1, identity.wireEncode(), SQLITE_TRANSIENT);
  sqlite3_bind_block(statement, 2, keyName.wireEncode(), SQLITE_TRANSIENT);
  sqlite3_bind_int(statement, 3, key.getKeyType());
  sqlite3_bind_blob(statement, 4, key.get().buf(), key.get().size(), SQLITE_STATIC);
  sqlite3_step(statement);
  sqlite3_finalize(statement);

  return sqlite3_last_insert_rowid(m_database);
}
开发者ID:CSUL,项目名称:ndn-tools,代码行数:24,代码来源:pib-db.cpp

示例9: applyAEffect

void Unit::applyAEffect(Name effectName, float playtime)
{
	if (!effectName.empty())
		m_actor->playEffect(effectName, playtime);
}
开发者ID:aa13058219642,项目名称:My-Tower-Defents-Freamwork,代码行数:5,代码来源:Unit.cpp

示例10: applyAction

void Unit::applyAction(Name actionName, float playtime)
{
	if (!actionName.empty())
		m_actor->playAction(actionName, playtime);
}
开发者ID:aa13058219642,项目名称:My-Tower-Defents-Freamwork,代码行数:5,代码来源:Unit.cpp


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