当前位置: 首页>>代码示例>>C++>>正文


C++ UUID::isNull方法代码示例

本文整理汇总了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);


}
开发者ID:openvstorage,项目名称:volumedriver,代码行数:25,代码来源:UUIDTest.cpp

示例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);
}
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:25,代码来源:SchedulesTabController.cpp

示例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());
}
开发者ID:cshnick,项目名称:CommunicationModel,代码行数:10,代码来源:UUIDTest.cpp

示例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];
    }
}
开发者ID:bubbletreefrog,项目名称:DLNA,代码行数:53,代码来源:DLNADelegation.cpp

示例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);
}
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:15,代码来源:SchedulesTabController.cpp

示例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());
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:48,代码来源:Component_GTest.cpp

示例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));
}
开发者ID:cshnick,项目名称:CommunicationModel,代码行数:42,代码来源:UUIDTest.cpp

示例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];
    }
}
开发者ID:daddyreb,项目名称:Bigit_Genie,代码行数:36,代码来源:DLNAProxy.cpp


注:本文中的UUID::isNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。