本文整理汇总了C++中UUID::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ UUID::isNull方法的具体用法?C++ UUID::isNull怎么用?C++ UUID::isNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::isNull方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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);
}
示例2: addWinterProfile
void SchedulesTabController::addWinterProfile(model::ScheduleRuleset & scheduleRuleset, UUID scheduleDayHandle)
{
boost::optional<model::ScheduleDay> scheduleDay;
if (!scheduleDayHandle.isNull()){
boost::optional<model::ScheduleDay> scheduleDayToCopy = scheduleRuleset.model().getModelObject<model::ScheduleDay>(scheduleDayHandle);
if (scheduleDayToCopy){
scheduleDay = scheduleDayToCopy->clone().cast<model::ScheduleDay>();
}
}
if (!scheduleDay){
scheduleDay = model::ScheduleDay(scheduleRuleset.model());
boost::optional<model::ScheduleTypeLimits> limits = scheduleRuleset.scheduleTypeLimits();
if (limits) {
scheduleDay->setScheduleTypeLimits(*limits);
}
scheduleDay->addValue(Time(1, 0), defaultStartingValue(*scheduleDay));
}
OS_ASSERT(scheduleDay);
scheduleRuleset.setWinterDesignDaySchedule(*scheduleDay);
scheduleDay->remove();
m_schedulesView->showWinterScheduleDay(scheduleRuleset);
}
示例3: testTryParse
void UUIDTest::testTryParse()
{
UUID uuid;
assert (uuid.tryParse("6BA7B810-9DAD-11D1-80B4-00C04FD430C8"));
assert (uuid.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
UUID notUuid;
assert (!notUuid.tryParse("not a uuid"));
assert (notUuid.isNull());
}
示例4: openMediaObj
void DLNADelegation::openMediaObj(const deejay::DLNAItem* mediaItem)
{
DeviceDescList devlist = m_core->snapshotMediaServerList();
UUID renderUuid = devlist.itemAt(0)->uuid();
DLNAObjectList objList;
DLNAObject * obj = objList.itemAt(0);
DLNAItem * item = obj->asItem();
// deejay::UUID renderUuid = getCurrentRenderUUID();
if (!renderUuid.isNull())
{
DLNAMediaObjType type;
getMediaObjType(mediaItem, type);
NPT_String iconUrl;
if (((deejay::DLNAObject*)mediaItem)->findThumbnailURL(200, 200, NULL, iconUrl))
{
//setThumbImg(iconUrl, type);
}
deejay::DLNACoreOp *op;
if (NPT_SUCCEEDED(m_core->playMedia(renderUuid, mediaItem, &op)))
{
if (wait(op))
{
if (op->succeeded())
{
//[m_delegate showControlPointPageWithMediaType:type];
}
else
{
printf("play op un successed");
printf("\n");
}
}
else
{
printf("wait wrong-->click cancle btn");
printf("\n");
}
op->release();
}
else
{
//NSLog(@"create Op error");
}
}
else
{
//[m_delegate shouldSelectRenderForMedia:mediaItem];
}
}
示例5: addRule
void SchedulesTabController::addRule(model::ScheduleRuleset & scheduleRuleset, UUID scheduleDayHandle)
{
boost::optional<model::ScheduleRule> rule;
if (!scheduleDayHandle.isNull()){
boost::optional<model::ScheduleDay> scheduleDayToCopy = scheduleRuleset.model().getModelObject<model::ScheduleDay>(scheduleDayHandle);
if (scheduleDayToCopy){
rule = model::ScheduleRule(scheduleRuleset, scheduleDayToCopy->clone().cast<model::ScheduleDay>());
}
}
if (!rule){
rule = model::ScheduleRule(scheduleRuleset);
rule->daySchedule().addValue(Time(1, 0), defaultStartingValue(rule->daySchedule()));
}
OS_ASSERT(rule);
}
示例6: designDay
TEST_F(ModelFixture, ComponentWatcher_ComponentData_Interactions) {
// create osm file that contains ComponentData
Model model;
DesignDay designDay(model);
EXPECT_EQ(1u,model.numObjects());
Component designDayComponent = designDay.createComponent();
ComponentData componentData = designDayComponent.componentData();
UUID uuid = componentData.uuid();
UUID versionUUID = componentData.versionUUID();
EXPECT_FALSE(versionUUID.isNull());
model = Model();
EXPECT_EQ(0u,model.numObjects());
OptionalComponentData ocd = model.insertComponent(designDayComponent);
ASSERT_TRUE(ocd);
EXPECT_EQ(2u,model.numObjects());
// simple insert should not change component UUIDs.
componentData = *ocd;
EXPECT_EQ(uuid,componentData.uuid());
EXPECT_EQ(versionUUID,componentData.versionUUID());
// changing data fields of component objects causes version id to change
componentData.primaryComponentObject().cast<DesignDay>().setMaximumDryBulbTemperature(50.0);
EXPECT_EQ(uuid,componentData.uuid());
EXPECT_NE(versionUUID,componentData.versionUUID());
versionUUID = componentData.versionUUID();
// trying to change contents field to an invalid value directly is not allowed
IdfExtensibleGroup eg = componentData.getExtensibleGroup(0);
ASSERT_FALSE(eg.empty());
std::string originalValue = eg.getString(0).get();
EXPECT_EQ("Sizing Period Design Day 1",originalValue);
EXPECT_FALSE(eg.setString(0,"My Material"));
EXPECT_TRUE(componentData.initialized());
EXPECT_EQ(2u,model.numObjects());
EXPECT_EQ(originalValue,eg.getString(0).get());
// ComponentData.remove() is okay (should automatically delete the ComponentWatcher)
ocd = model.insertComponent(designDayComponent);
ASSERT_TRUE(ocd);
// should find original DesignDay and reinstantiate ComponentData
EXPECT_EQ(2u,model.numObjects());
componentData = *ocd;
ASSERT_TRUE(componentData.initialized());
EXPECT_FALSE(componentData.remove().empty());
EXPECT_EQ(static_cast<unsigned>(1),model.numObjects());
}
示例7: testCompare
void UUIDTest::testCompare()
{
UUID null;
assert (null.isNull());
assert (UUID::null().isNull());
UUID uuid1 = null;
UUID uuid2;
assert (uuid1.isNull());
assert (uuid1 == null);
assert (!(uuid1 != null));
assert (uuid1 >= null);
assert (uuid1 <= null);
assert (!(uuid1 > null));
assert (!(uuid1 < null));
assert (uuid1.toString() == "00000000-0000-0000-0000-000000000000");
uuid1 = UUID::dns();
assert (!uuid1.isNull());
assert (uuid1 != null);
assert (!(uuid1 == null));
assert (uuid1 >= null);
assert (!(uuid1 <= null));
assert (uuid1 > null);
assert (!(uuid1 < null));
assert (uuid1.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
assert (null != uuid1);
assert (!(null == uuid1));
assert (!(null >= uuid1));
assert (null <= uuid1);
assert (!(null > uuid1));
assert (null < uuid1);
uuid2 = uuid1;
assert (uuid2 == uuid1);
assert (!(uuid2 != uuid1));
assert (uuid2 >= uuid1);
assert (uuid2 <= uuid1);
assert (!(uuid2 > uuid1));
assert (!(uuid2 < uuid1));
}
示例8: openMediaObj
void DLNAProxy::openMediaObj(const SiteView::DLNAItem* mediaItem)
{
DeviceDescList devlist = m_core->snapshotMediaServerList();
UUID renderUuid = devlist.itemAt(0)->uuid();
DLNAObjectList objList;
DLNAObject * obj = objList.itemAt(0);
DLNAItem * item = obj->asItem();
// SiteView::UUID renderUuid = getCurrentRenderUUID();
if (!renderUuid.isNull())
{
DLNAMediaObjType type;
getMediaObjType(mediaItem, type);
NPT_String iconUrl;
if (((SiteView::DLNAObject*)mediaItem)->findThumbnailURL(200, 200, NULL, iconUrl))
{
//setThumbImg(iconUrl, type);
}
SiteView::DLNACoreOp *op;
if (NPT_SUCCEEDED(m_core->playMedia(renderUuid, mediaItem, &op)))
{
op->release();
}
else
{
//NSLog(@"create Op error");
}
}
else
{
//[m_delegate shouldSelectRenderForMedia:mediaItem];
}
}