本文整理汇总了C++中Transporter::Final方法的典型用法代码示例。如果您正苦于以下问题:C++ Transporter::Final方法的具体用法?C++ Transporter::Final怎么用?C++ Transporter::Final使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transporter
的用法示例。
在下文中一共展示了Transporter::Final方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_explorer
void test_explorer()
{
#define TEST_EXPORT
#define TEST_THREADS
enum {
queueBufferSize = 4096*8,
};
char queueBuffer[queueBufferSize];
TransportParams* pParams;
Transporter transporter;
pParams = transporter.TransportDataInit(
#ifdef TEST_EXPORT
TRUE,
#else
FALSE, //importMode
#endif
queueBuffer,
queueBufferSize,
FS_FILE_SWAP,
#ifdef TEST_EXPORT
MULTI_PATHS_ZEXPORT
#else
MULTI_PATHS_ZIMPPORT
#endif
);
transporter.Init(pParams);
#ifdef TEST_THREADS
transporter.Start();
for (;;) {
TransportStatus status;
transporter.GetStatus(&status);
_tprintf(TEXT("status %d expl %I64d xpot %I64d\n"), status.stateFlags, status.exploredSize, status.xportedSize);
if (status.stateFlags & TransportStatus::xportingComplete)
break;
Sleep(500);
}
#else //TEST_THREADS
#ifdef TEST_EXPORT
transporter.ExploreThreadMain();
transporter.XportThreadMain();
#else
transporter.XportThreadMain();
#endif
#endif //TEST_THREADS
transporter.Final();
transporter.TransportDataFinal(pParams);
}
示例2: shell_xpot
//<export/import> [zParams]
void shell_xpot(int argc, TCHAR* argv[])
{
int rc;
int nDone = 0;
int isExport = 0;
TCHAR* zParams;
TCHAR zSwapFile[MAX_PATH];
enum {
queueBufferSize = 4096*8,
};
char queueBuffer[queueBufferSize];
TransportParams* pParams;
Transporter transporter;
do {
//(1) get input args
if (argc < 2) break;
if (_tcscmp(argv[1], TEXT("export")) == 0) {
zParams = MULTI_PATHS_ZEXPORT;
isExport = TRUE;
}
else if (_tcscmp(argv[1], TEXT("import")) == 0) {
zParams = MULTI_PATHS_ZIMPPORT;
isExport = FALSE;
} else
break;
if (argc == 3) zParams = argv[2];
nDone = 1;
//(2) init params
GetModuleDir(zSwapFile, MAX_PATH);
pathMng path;
path.pathPush(zSwapFile, MAX_PATH, TEXT("\\fs.bin"));
pParams = transporter.TransportDataInit(
isExport,
queueBuffer,
queueBufferSize,
zSwapFile,
zParams
);
rc = transporter.Init(pParams);
if (rc) break;
transporter.Start();
for (int i = 0;;i++) {
TransportStatus status;
transporter.GetStatus(&status);
_tprintf(TEXT("status %d expl %I64d xpot %I64d\n"), status.stateFlags, status.exploredSize, status.xportedSize);
if (status.stateFlags & TransportStatus::xportingComplete)
break;
#if (1)
Sleep(500);
#else //test interrupt
Sleep(50);
if (i==1) {
transporter.Cancel();
}
#endif
}
transporter.Final();
nDone = 2;
} while(FALSE);
switch (nDone) {
case 2:
break;
case 1:
_tprintf(TEXT("init fail\n"));
break;
default:
assert(nDone == 0);
_tprintf(TEXT("<export/import> [zParams]\n"));
break;
}
}