本文整理汇总了C++中TestObject::objectId方法的典型用法代码示例。如果您正苦于以下问题:C++ TestObject::objectId方法的具体用法?C++ TestObject::objectId怎么用?C++ TestObject::objectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestObject
的用法示例。
在下文中一共展示了TestObject::objectId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
/* get the NetAddr of the server */
NetAddr netAddr(argv[1]);
/* get netaddr to the proxy */
NetAddr proxy(argv[2]);
/* get size of objects */
int objectSize;
istringstream ss(argv[3]);
ss >> objectSize;
/* Initialize Server with our NetAddr */
Ginnungagap::Initialize(SERVER, 50, netAddr, netAddr);
/* Start necessary threads */
Ginnungagap::Instance()->startDataSenderThread();
Ginnungagap::Instance()->startDataAndConnectionReceiverThread();
Ginnungagap::Instance()->startMessageHandlerThread();
/* set terminal in ``any key''-mode */
struct termios oldT, newT;
ioctl(0, TCGETS, &oldT);
newT = oldT;
newT.c_lflag &= ~ECHO;
newT.c_lflag &= ~ICANON;
ioctl(0, TCSETS, &newT);
cout << "Press any key once proxy is connected" << endl;
cin.get();
cout << "Migrating objects..." << endl;
TestObject* test;
for (int i = 0; i != 10000; ++i)
{
test = new TestObject(objectSize);
Ginnungagap::Instance()->nameService()->bind(*test);
Ginnungagap::Instance()->migrationService()->migrateObject(test->objectId(), proxy);
usleep(30000);
}
cout << "Done migrating objects, press any key to exit" << endl;
cin.get();
/* restore original terminal mode */
ioctl(0, TCSETS, &oldT);
return 1;
}