本文整理汇总了C++中AttributeList::Iterator方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributeList::Iterator方法的具体用法?C++ AttributeList::Iterator怎么用?C++ AttributeList::Iterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeList
的用法示例。
在下文中一共展示了AttributeList::Iterator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
//config and create db
SparkseeConfig cfg;
Sparksee *sparksee = new Sparksee(cfg);
Database *db = sparksee->Create(L"tg.gdb", L"tg");
//create new session and get corresponding graph
Session *sess = db->NewSession();
Graph *g = sess->GetGraph();
//creation dun nouveau type
type_t modelType = g->NewNodeType(L"MODEL");
//creation de deux nouveaux node
oid_t modelNode = g->NewNode(modelType);
oid_t modelNodeB = g->NewNode(modelType);
//verifie l'existance de lattr
//et ajout de lattr au nodeType si besoin
attr_t nameAttrId = g->FindAttribute(modelType, L"Name");
if (Attribute::InvalidAttribute == nameAttrId)
{
nameAttrId = g->NewAttribute(modelType, L"Name", String, Indexed);
}
//value utilisation de la class value pour set les attr
Value v;
g->SetAttribute(modelNode, nameAttrId, v.SetString(L"toto los patos"));
g->SetAttribute(modelNodeB, nameAttrId, v.SetString(L"tata los potas"));
AttributeList *aList = g->GetAttributes(modelNode);
AttributeListIterator *aListIt = aList->Iterator();
while(aListIt->HasNext()){
attr_t attrT = aListIt->Next();
Attribute *attr = g->GetAttribute(attrT);
std::wcout<<attr->GetName()<<std::endl;
}
delete g;
delete sess;
delete db;
delete sparksee;
return 0;
}