本文整理汇总了C++中Ptr::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::Append方法的具体用法?C++ Ptr::Append怎么用?C++ Ptr::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ptr
的用法示例。
在下文中一共展示了Ptr::Append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestRemappingOfOIs
void TestRemappingOfOIs(CObjectWriter* pcWriter, CObjectReader* pcReader)
{
CFileUtil cFileUtil;
Ptr<CTestSaveableObject2> cBase;
Ptr<CTestSaveableObject2> cStart1;
Ptr<CRoot> cRoot;
Ptr<CString> szOne;
Ptr<CString> cString1;
Ptr<CString> cString2;
CObjectGraphSerialiser cGraphSerialiser;
CObjectGraphDeserialiser cGraphDeserialiser;
Ptr<CTestSaveableObject1> cShared;
int i;
CObjectAllocator cAllocator;
CDependentReadObjects cDependentReadObjects;
cFileUtil.MakeDir("Output/GraphDeserialiser/Simple/Remapping");
ObjectsInit("Output/GraphDeserialiser/Simple/Remapping");
TestObjectGraphDeserialiserAddConstructors();
TestObjectGraphDeserialiserBuildGraph1();
cBase = gcObjects.Get("Ow/Start 1");
AssertTrue(cBase.IsNotNull());
AssertLongLongInt(3, cBase->GetOI());
cString1 = gcObjects.Get(6LL);
AssertString("Black", cString1->Text());
AssertLongLongInt(6LL, cString1->GetOI());
cString2 = gcObjects.Get(7LL);
AssertString("Jack", cString2->Text());
AssertLongLongInt(7LL, cString2->GetOI());
cGraphSerialiser.Init(pcWriter);
AssertTrue(cGraphSerialiser.Write(&cBase));
cGraphSerialiser.Kill();
pcWriter->Kill();
ObjectsKill();
ObjectsInit("Output/GraphDeserialiser/Simple/Remapping");
TestObjectGraphDeserialiserAddConstructors();
cRoot = ORoot();
for (i = 0; i < 20; i++)
{
szOne = OMalloc(CString);
szOne->Init("Hello World ");
szOne->Append(i);
cRoot->Add(szOne);
AssertLongLongInt(3+i, szOne->GetOI());
}
cAllocator.Init(&gcObjects);
cDependentReadObjects.Init();
cGraphDeserialiser.Init(pcReader, FALSE, &cAllocator, &cDependentReadObjects, gcObjects.GetMemory());
cStart1 = cGraphDeserialiser.Read("Ow/Start 1");
AssertTrue(cStart1.IsNotNull());
AssertLongLongInt(23, cStart1->GetOI());
AssertTrue(cStart1->mp1.IsNotNull());
AssertString("CTestSaveableObject1", cStart1->mp1->ClassName());
cShared = cStart1->mp1;
AssertLongLongInt(25, cShared->GetOI());
AssertTrue(cStart1->mp2.IsNotNull());
AssertString("CString", cStart1->mp2->ClassName());
cString1 = cStart1->mp2;
AssertLongLongInt(24, cString1->GetOI());
cGraphDeserialiser.Kill();
cDependentReadObjects.Kill();
cAllocator.Kill();
for (i = 0; i < 20; i++)
{
szOne = OMalloc(CString);
szOne->Init("Hello World ");
szOne->Append(i + 20);
cRoot->Add(szOne);
AssertLongLongInt(26+i, szOne->GetOI());
}
pcReader->Kill();
ObjectsKill();
}