本文整理汇总了C++中Library::CreateSubnetList方法的典型用法代码示例。如果您正苦于以下问题:C++ Library::CreateSubnetList方法的具体用法?C++ Library::CreateSubnetList怎么用?C++ Library::CreateSubnetList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library::CreateSubnetList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int CDECL main(int aArgc, char* aArgv[])
{
InitialisationParams* initParams = InitialisationParams::Create();
OptionParser parser;
OptionUint optionDuration("-d", "--duration", 30, "Number of seconds to run the test");
parser.AddOption(&optionDuration);
if (!parser.Parse(aArgc, aArgv)) {
return (1);
}
Library* lib = new Library(initParams);
std::vector<NetworkAdapter*>* subnetList = lib->CreateSubnetList();
TIpAddress subnet = (*subnetList)[0]->Subnet();
Library::DestroySubnetList(subnetList);
CpStack* cpStack = lib->StartCp(subnet);
// Debug::SetLevel(Debug::kTopology);
ReceiverManager1Logger* logger = new ReceiverManager1Logger(*cpStack);
Blocker* blocker = new Blocker(lib->Env());
blocker->Wait(optionDuration.Value());
delete blocker;
delete (logger);
Print("Closing ... ");
delete lib;
Print("closed\n");
}
示例2: endpt
void OpenHome::TestFramework::Runner::Main(TInt /*aArgc*/, TChar* /*aArgv*/[], Net::InitialisationParams* aInitParams)
{
Library* lib = new Library(aInitParams);
std::vector<NetworkAdapter*>* subnetList = lib->CreateSubnetList();
TIpAddress subnet = (*subnetList)[0]->Subnet();
TIpAddress addr = (*subnetList)[0]->Address();
Endpoint endpt(0, addr);
Endpoint::AddressBuf buf;
endpt.AppendAddress(buf);
Print("Connect to %s:%u then 'help' for options\n\n", buf.Ptr(), Shell::kServerPortDefault);
Library::DestroySubnetList(subnetList);
CpStack* cpStack = NULL;
DvStack* dvStack = NULL;
lib->StartCombined(subnet, cpStack, dvStack);
Shell* shell = new Shell(cpStack->Env());
Semaphore* blocker = new Semaphore("BLCK", 0);
std::vector<ShellTest> shellTests;
shellTests.push_back(ShellTest("TestBuffer", RunTestBuffer));
shellTests.push_back(ShellTest("TestThread", RunTestThread));
shellTests.push_back(ShellTest("TestFifo", RunTestFifo));
shellTests.push_back(ShellTest("TestQueue", RunTestQueue));
shellTests.push_back(ShellTest("TestTextUtils", RunTestTextUtils));
shellTests.push_back(ShellTest("TestNetwork", RunTestNetwork, true));
shellTests.push_back(ShellTest("TestTimer", RunTestTimer));
shellTests.push_back(ShellTest("TestSsdpMListen", RunTestSsdpMListen, true));
shellTests.push_back(ShellTest("TestSsdpUListen", RunTestSsdpUListen, true));
shellTests.push_back(ShellTest("TestDeviceList", RunTestDeviceList, true));
shellTests.push_back(ShellTest("TestInvocation", RunTestInvocation));
shellTests.push_back(ShellTest("TestSubscription", RunTestSubscription));
shellTests.push_back(ShellTest("TestCpDeviceDv", RunTestCpDeviceDv));
shellTests.push_back(ShellTest("TestDviDiscovery", RunTestDviDiscovery));
shellTests.push_back(ShellTest("TestDviDeviceList", RunTestDviDeviceList));
shellTests.push_back(ShellTest("TestDvInvocation", RunTestDvInvocation));
shellTests.push_back(ShellTest("TestDvSubscription", RunTestDvSubscription));
shellTests.push_back(ShellTest("TestDvLpec", RunTestDvLpec));
shellTests.push_back(ShellTest("TestException", RunTestException));
shellTests.push_back(ShellTest("TestFunctorGeneric", RunTestFunctorGeneric));
shellTests.push_back(ShellTest("TestXmlParser", RunTestXmlParser));
ShellCommandRun* cmdRun = new ShellCommandRun(*cpStack, *dvStack, *shell, shellTests);
ShellCommandDebug* cmdDebug = new ShellCommandDebug(*shell);
ShellCommandQuit* cmdQuit = new ShellCommandQuit(*shell, *blocker);
ShellCommandWatchDog* cmdWatchDog = new ShellCommandWatchDog(*shell, 60); // default to 60s watchdog. This can be changed at runtime by client.
blocker->Wait();
// control never reaches here
delete blocker;
delete cmdWatchDog;
delete cmdQuit;
delete cmdDebug;
delete cmdRun;
delete shell;
delete lib;
}
示例3: loopback
void OpenHome::TestFramework::Runner::Main(TInt aArgc, TChar* aArgv[], Net::InitialisationParams* aInitParams)
{
OptionParser parser;
OptionBool loopback("-l", "--loopback", "Use the loopback adapter only");
parser.AddOption(&loopback);
if (!parser.Parse(aArgc, aArgv) || parser.HelpDisplayed()) {
return;
}
if (loopback.Value()) {
aInitParams->SetUseLoopbackNetworkAdapter();
}
aInitParams->SetDvUpnpServerPort(0);
Library* lib = new Library(aInitParams);
std::vector<NetworkAdapter*>* subnetList = lib->CreateSubnetList();
TIpAddress subnet = (*subnetList)[0]->Subnet();
Library::DestroySubnetList(subnetList);
CpStack* cpStack = NULL;
DvStack* dvStack = NULL;
lib->StartCombined(subnet, cpStack, dvStack);
TestDvSubscription(*cpStack, *dvStack);
delete lib;
}