本文整理汇总了C++中Identifier::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ Identifier::clone方法的具体用法?C++ Identifier::clone怎么用?C++ Identifier::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Identifier
的用法示例。
在下文中一共展示了Identifier::clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
int
main(int argc, char *argv[])
{
char *url, *user, *pass, *capath;
SSRC *ssrc = NULL;
ARC *arc = NULL;
PublishRequest *pr = NULL;
PublishUpdate *pu = NULL;
SubscribeRequest *sr = NULL;
SubscribeUpdate *su1 = NULL;
SubscribeUpdate *su2 = NULL;
list<SubscribeElement *> sulist;
PollResult *pres = NULL;
Identifier *ar;
XmlMarshalable *md;
string errsub;
string goodsub;
checkAndLoadParameters(argc, argv, 0, usage, &url, &user,
&pass, &capath);
// create ssrc object which is used for synchronous communication
ssrc = SSRC::createSSRC(url, user, pass, capath);
arc = ssrc->getARC();
ar = Identifiers::createAr(user);
// 200 bytes
md = Metadata::createDevAttr(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
);
su1 = Requests::createSubscribeUpdate(
BADSUB,
FILTER_MATCH_ALL,
SEARCH_NO_MAX_DEPTH,
FILTER_MATCH_ALL,
BADSUBMAX,
ar->clone());
su2 = Requests::createSubscribeUpdate(
GOODSUB,
FILTER_MATCH_ALL,
SEARCH_NO_MAX_DEPTH,
FILTER_MATCH_ALL,
GOODSUBMAX,
ar->clone());
sulist.push_back(su1);
sulist.push_back(su2);
sr = Requests::createSubscribeReq(sulist);
pu = Requests::createPublishUpdate(md, ar);
pr = Requests::createPublishReq(pu);
pr->addXmlNamespaceDefinition(TCG_META_NSPAIR);
try {
ssrc->newSession();
ssrc->subscribe(sr);
pres = arc->poll();
if (pres->getSearchResults().size() != 2) {
cerr << "Unexpected searchResults count" << endl;
goto clean;
}
delete pres;
ssrc->publish(pr);
pres = arc->poll();
if (pres->getErrorResults().size() != 1) {
cerr << "Unexpected errorResuls count" << endl;
goto clean;
}
if (pres->getUpdateResults().size() != 1) {
cerr << "Unexpected updateResuls count" << endl;
goto clean;
}
errsub = pres->getErrorResults().front()->getName();
if (errsub.compare(BADSUB)) {
cerr << BADSUB " is not the bad one" << endl;
goto clean;
}
delete pres;
// this part is to see whether GOODSUB is still
// there...
ssrc->publish(pr);
pres = arc->poll();
if (pres->getUpdateResults().size() != 1) {
cerr << "Unexpected updateResuls count" << endl;
goto clean;
//.........这里部分代码省略.........
示例2: Factory
OTIdentifier Identifier::Factory(const Identifier& rhs)
{
return OTIdentifier(rhs.clone());
}