本文整理汇总了C++中UUID::str方法的典型用法代码示例。如果您正苦于以下问题:C++ UUID::str方法的具体用法?C++ UUID::str怎么用?C++ UUID::str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::str方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerInterestInUuid
void NetworkDiscoveryClient::registerInterestInUuid(device_t id, UUID uuid, bool isService, std::function<void()> cb) {
std::stringstream resource;
resource << "network/registerInterest/" << ((isService) ? "service" : "char") << "/" << std::fixed << id
<< "/" << uuid.str();
std::string url = client->getApiUrl(resource.str());
using namespace boost::network;
http::client::request request(url);
request << header("User-Agent", "linux");
request << header(ControllerClient::SESSION_HEADER, client->getSessionToken());
try {
auto response = client->getClient()->post(request);
if (response.status() != 200) {
if (debug_controller) {
std::stringstream ss;
ss << "error registering interest: " << body(response);
pdebug(ss.str());
}
}
} catch (std::exception &e) {
pexcept(e);
}
/*
* TODO: might want to wait
*/
cb();
}
示例2:
TEST_F(UUIDTest, test4)
{
UUID uuid = UUID::NullUUID();
ASSERT_TRUE(uuid.isNull());
const UUID& uuid1 = UUID::NullUUID();
ASSERT_TRUE(uuid.isNull());
ASSERT_TRUE(uuid == uuid1);
UUID uuid2(uuid1);
ASSERT_TRUE(uuid2.isNull());
ASSERT_TRUE(uuid2 == uuid1);
UUID uuid3 = uuid1;
ASSERT_TRUE(uuid3.isNull());
ASSERT_TRUE(uuid3 == uuid1);
std::string s = uuid.str();
ASSERT_TRUE(s.size() == 36);
UUID uuid4(s);
ASSERT_TRUE(uuid4.isNull());
ASSERT_TRUE(uuid4 == uuid);
}
示例3: discoverByUuid
bool NetworkDiscoveryClient::discoverByUuid(UUID uuid, std::list<discovery_result_t> &ret, bool isService, device_t d) {
std::stringstream resource;
resource << "network/discover/" << ((isService) ? "service" : "char") << "/" << uuid.str();
if (d != -1) {
resource << "?gateway=" << beetle.name << "&" << "remote_id" << std::fixed << d;
}
return queryHelper(resource.str(), ret);
}
示例4: findEntityIdx
bool WorldModel::findEntityIdx(const UUID& id, Idx& idx) const
{
if (id.idx != INVALID_IDX && entities_[id.idx] && entities_[id.idx]->id() == id.str())
{
idx = id.idx;
return true;
}
std::map<UUID, Idx>::const_iterator it = entity_map_.find(id);
if (it == entity_map_.end())
return false;
idx = it->second;
id.idx = idx;
return true;
}