本文整理汇总了C++中Link::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ Link::empty方法的具体用法?C++ Link::empty怎么用?C++ Link::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: note
void note(int usecs)
{
Ttask *t;
for(t=timer_tasks.next;t;t=t->link.next)
if(t->usecs>0)
{
t->usecs-=usecs;
}
while (!timer_tasks.empty() && timer_tasks.next->usecs<=0)
{
t=timer_tasks.next;
timer_tasks.deque(t);
t->fn->cont(t->fn);
delete t;
}
}
示例2: linkFromNode
bool Parser::linkFromNode(const XMLNode& linkNode, Link& linkInfo)
{
if (!linkNode.isElementNode() or (linkNode.getNameAsString() != "link"))
return false;
//link should not have any child nodes
if (linkNode.hasChild())
return false;
const auto attributes = linkNode.getAttributes();
if (attributes.empty())
{
std::cout << "Link element should have at least one attribute!" << std::endl;
return false;
} //if not enough attributes
//initialize element with empty values
linkInfo = Link();
for (const auto& a : attributes)
{
const std::string attrName = a.first;
if (attrName == "href")
{
if (!linkInfo.href().empty())
{
std::cout << "Link element already has a href value!" << std::endl;
return false;
} //if href was already specified
linkInfo.setHref(a.second);
} //if href
else if (attrName == "rel")
{
if (!linkInfo.rel().empty())
{
std::cout << "Link element already has a rel attribute!" << std::endl;
return false;
} //if rel was already specified
linkInfo.setRel(a.second);
} //if rel
else if (attrName == "type")
{
if (!linkInfo.type().empty())
{
std::cout << "Link element already has a type attribute!" << std::endl;
return false;
} //if type was already specified
linkInfo.setType(a.second);
} //if type
else if (attrName == "hreflang")
{
if (!linkInfo.hreflang().empty())
{
std::cout << "Link element already has a hreflang attribute!" << std::endl;
return false;
} //if hreflang was already specified
linkInfo.setHreflang(a.second);
} //if hreflang
else if (attrName == "title")
{
if (!linkInfo.title().empty())
{
std::cout << "Link element already has a title attribute!" << std::endl;
return false;
} //if title was already specified
linkInfo.setTitle(a.second);
} //if title
else if (attrName == "length")
{
if (linkInfo.length() > 0)
{
std::cout << "Link element already has a length attribute!" << std::endl;
return false;
} //if length was already specified
uint64_t tempUnsigned = 0;
if (!stringToUnsignedInt<uint64_t>(a.second, tempUnsigned))
{
std::cout << "Length attribute of link element must have an integer value!" << std::endl;
return false;
}
if (tempUnsigned == 0)
{
std::cout << "Length attribute of link element must not be zero!" << std::endl;
return false;
}
linkInfo.setLength(tempUnsigned);
} //if length
else
{
std::cout << "Error: found unknown attribute " << a.first
<< " in <link> element of Atom 1.0 feed!" << std::endl;
return false;
}
} //for
//structure should not be empty
return (!linkInfo.empty());
}
示例3: Alloc
Alloc()
: mutex("!StdioAllocMutex")
{
list.empty();
}
示例4: ObjPool
ObjPool()
{
list.empty();
for(Obj *ptr=reserved,*lim=ptr+FOPEN_MAX; ptr<lim ;ptr++) put(ptr);
}