本文整理汇总了C++中TName::AppendNum方法的典型用法代码示例。如果您正苦于以下问题:C++ TName::AppendNum方法的具体用法?C++ TName::AppendNum怎么用?C++ TName::AppendNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TName
的用法示例。
在下文中一共展示了TName::AppendNum方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetResolverConfig
TInt CTS_MultiHomingStep::GetResolverConfig(const TInt aIndex, TName &aHostName, TInt& aProtocol,
TBool& aExpectSuccess, TBool& aExpectTimeout, TBool& aExpectNotReady,
TBool& aExplicitResolve, TConnDetails **aConnDetails)
/**
* Gets resolver configuration from file, using defaults if necessary
* @param aIndex The index for the socket configkey
* @param aHostName The host to be resolved
* @param aProtocol The protocol to be used
* @param aExpectSuccess Flag indicating if name should be resolved ok
* @param aExpectTimeout Flag indicating if name resolution should timeout
* @param aConnDetails The connection for an explicit resolver
* @return System wide error code
*/
{
TInt err=KErrNone;
TName resolverName; // Create the Key for the config lookup
resolverName = KResolver;
resolverName.AppendNum(aIndex);
TPtrC ptrBuf;
err = GetStringFromConfig(resolverName, KDestName, ptrBuf);
if (!err)
{
LogExtra((TText8*)__FILE__, __LINE__, ESevrWarn, KEConfigFile);
iTestStepResult= EInconclusive;
return KErrNotFound;
}
aHostName.Copy(ptrBuf.Ptr(), ptrBuf.Length());
aExpectSuccess = ETrue;
GetBoolFromConfig(resolverName, KExpectSuccess, aExpectSuccess);
aExpectTimeout = EFalse;
GetBoolFromConfig(resolverName, KExpectTimeout, aExpectTimeout);
aExpectNotReady = EFalse;
GetBoolFromConfig(resolverName, KExpectNoDnsServer, aExpectNotReady);
aExplicitResolve = EFalse;
GetBoolFromConfig(resolverName, KExplicitResolve, aExplicitResolve);
err = GetStringFromConfig(resolverName, KProtocol, ptrBuf);
if (err && (ptrBuf.Compare(KTcp)==0))
aProtocol = KProtocolInetTcp;
else
aProtocol = KProtocolInetUdp;
err = GetStringFromConfig(resolverName, KConnName, ptrBuf);
if (!err)
{
return KErrNotFound;
}
*aConnDetails = iOwnerSuite->GetTConnection(ptrBuf);
return KErrNone;
}
示例2: StartThreadL
// -----------------------------------------------------------------------------
// TMSCallServer::StartThreadL
//
// -----------------------------------------------------------------------------
//
void TMSCallServer::StartThreadL(TMSCallServerStartParam& aStart)
{
TRACE_PRN_FN_ENT;
CActiveScheduler* sched = new (ELeave) CActiveScheduler;
CleanupStack::PushL(sched);
CActiveScheduler::Install(sched);
TMSCallServer* server = TMSCallServer::NewL(aStart.iTMSServer);
CleanupStack::PushL(server);
//Rename tmscall server name
RThread tmscallServerThread;
TThreadId threadId;
TName name;
name.Append(KTMSCallServerName);
threadId = tmscallServerThread.Id();
name.AppendNum(threadId.Id(), EHex);
//We are ignoring the error code returned from User::RenameThread
//as it is not important here, may be for profiling
User::RenameThread(name);
aStart.iTMSCallServerHandle = server->Server();
// Sync with the client and enter the active scheduler
RThread::Rendezvous(KErrNone);
sched->Start();
CleanupStack::PopAndDestroy(server); // server
CleanupStack::PopAndDestroy(sched); // sched
TRACE_PRN_FN_EXT;
}
示例3: CreateServerProcess
// -----------------------------------------------------------------------------
// MceServerStarter::CreateServerProcess
// -----------------------------------------------------------------------------
//
TInt MceServerStarter::CreateServerProcess (RSemaphore& aSemaphore)
{
const TUidType serverUid (KNullUid, KNullUid, KServerUid3);
#if ((defined (__WINS__) || defined(__WINSCW__)) && !defined (EKA2))
RLibrary lib;
RETURN_IF_ERROR (lib.Load(KMceServerFilename,serverUid))
// Get the WinsMain function
TLibraryFunction functionWinsMain = lib.Lookup (1);
// Call it and cast the result to a thread function
TThreadFunction serverThreadFunction =
reinterpret_cast<TThreadFunction> (functionWinsMain());
TName threadName (KSipServerName);
// Append a random number to make it unique
threadName.AppendNum (Math::Random(), EHex);
RThread server;
TInt err = server.Create (threadName,
serverThreadFunction, // thread's main function
KDefaultStackSize,
NULL,
&lib,
NULL,
KServerMinHeapSize,
KServerMaxHeapSize,
EOwnerProcess );
lib.Close (); // if successful, server thread has handle to library now
RETURN_IF_ERROR (err)
server.SetPriority (EPriorityMore);
#else // HW build
RProcess server;
RETURN_IF_ERROR (server.Create( KMceServerName, KNullDesC, serverUid ) )
#endif
server.Resume ();
aSemaphore.Wait();
TInt exitReason = server.ExitReason();
server.Close ();
return exitReason;
}
示例4: doTestStepL
TVerdict CSimPacketGPRSQOSTest::doTestStepL()
{
INFO_PRINTF1(_L("BeginPacketGPRSQOSTest"));
CreateConfigFileL(_L("c:\\config3.txt"));
SetTestNumberL(6);
TInt ret = iPhone.Open(iTelServer,KPhoneName);
INFO_PRINTF2(_L("Result: %d"),ret);
TESTL(ret == KErrNone);
INFO_PRINTF1(_L("Opened phone object"));
TESTL(iPacketService.Open(iPhone)==KErrNone);
INFO_PRINTF1(_L("Opened Packet object"));
TName contextName;
TName contextNameCompare;
TESTL(iFirstPrimaryPacketContext.OpenNewContext(iPacketService, contextName)==KErrNone);
contextNameCompare.Append(KSimPrimaryPacketContextName);
contextNameCompare.AppendNum(1);
TESTL(contextName.Compare(contextNameCompare)==KErrNone);
INFO_PRINTF1(_L("Opened Context object"));
TRequestStatus reqStatus;
TRequestStatus notifyStatus;
TName gprsQosName;
TESTL(iGPRSPacketqos.OpenNewQoS(iFirstPrimaryPacketContext, gprsQosName)==KErrNone);
TName gprsQosNameCompare;
gprsQosNameCompare.Append(KSimPacketQosName);
gprsQosNameCompare.AppendNum(1);
TESTL(gprsQosName.Compare(gprsQosNameCompare)==KErrNone);
INFO_PRINTF1(_L("Opened GPRS QoS object"));
TName qosname;
iFirstPrimaryPacketContext.GetProfileName(qosname);
INFO_PRINTF1(_L("Retrieved GPRS QoS object reference name"));
// Set QoS Profile Params
RPacketQoS::TQoSGPRSRequested aGPRSQoSReqConfig;
TPckg<RPacketQoS::TQoSGPRSRequested> aGPRSQoSReqPckg(aGPRSQoSReqConfig);
// post a notification
RPacketQoS::TQoSGPRSNegotiated aGPRSNotifyQoS;
TPckg<RPacketQoS::TQoSGPRSNegotiated> aGPRSNotifyQoSPckg(aGPRSNotifyQoS);
//Profile data
aGPRSQoSReqConfig.iMinDelay = RPacketQoS::EDelayClass1;
aGPRSQoSReqConfig.iMinMeanThroughput = RPacketQoS::EMeanThroughput200;
aGPRSQoSReqConfig.iMinPeakThroughput = RPacketQoS::EPeakThroughput16000;
aGPRSQoSReqConfig.iMinPrecedence = RPacketQoS::EPriorityLowPrecedence;
aGPRSQoSReqConfig.iMinReliability = RPacketQoS::EReliabilityClass1;
aGPRSQoSReqConfig.iReqDelay = RPacketQoS::EDelayClass2;
aGPRSQoSReqConfig.iReqMeanThroughput = RPacketQoS::EMeanThroughput2000;
aGPRSQoSReqConfig.iReqPeakThroughput = RPacketQoS::EPeakThroughput64000;
aGPRSQoSReqConfig.iReqPrecedence = RPacketQoS::EPriorityMediumPrecedence;
aGPRSQoSReqConfig.iReqReliability = RPacketQoS::EReliabilityClass2;
//post the notification
iGPRSPacketqos.NotifyProfileChanged(notifyStatus, aGPRSNotifyQoSPckg);
//Set the config
iGPRSPacketqos.SetProfileParameters(reqStatus, aGPRSQoSReqPckg);
User::WaitForRequest(notifyStatus);
User::WaitForRequest(reqStatus);
TESTL(aGPRSNotifyQoS.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
TESTL(aGPRSNotifyQoS.iDelay == RPacketQoS::EDelayClass2);
TESTL(aGPRSNotifyQoS.iDelay == RPacketQoS::EDelayClass2);
TESTL(aGPRSNotifyQoS.iMeanThroughput == RPacketQoS::EMeanThroughput2000);
TESTL(aGPRSNotifyQoS.iPeakThroughput == RPacketQoS::EPeakThroughput64000);
TESTL(aGPRSNotifyQoS.iPrecedence == RPacketQoS::EPriorityMediumPrecedence);
TESTL(aGPRSNotifyQoS.iReliability == RPacketQoS::EReliabilityClass2);
// post a notification
TRequestStatus cancelStatus;
iGPRSPacketqos.NotifyProfileChanged(cancelStatus, aGPRSNotifyQoSPckg);
iGPRSPacketqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
User::WaitForRequest(cancelStatus);
TESTL(cancelStatus.Int()==KErrCancel);
INFO_PRINTF1(_L("Set Profile Test passed"));
// need to call Notify first to set pending to true after
// cancel event which sets it to false
iGPRSPacketqos.NotifyProfileChanged(notifyStatus, aGPRSNotifyQoSPckg);
iGPRSPacketqos.SetProfileParameters(reqStatus, aGPRSQoSReqPckg);
User::WaitForRequest(notifyStatus);
TESTL(notifyStatus.Int()==KErrNone);
User::WaitForRequest(reqStatus);
TESTL(reqStatus.Int()==KErrNone);
// test RPacketContext::Activate - before calling ModifyActiveContext
StartNTRasSimulation();
iFirstPrimaryPacketContext.Activate(reqStatus);
User::WaitForRequest(reqStatus);
TESTL(reqStatus.Int()==KErrNone);
INFO_PRINTF1(_L("Activate test passed"));
// test RPacketContext::ModifyActiveContext - it shouldn't work unless
// a profile/tft has changed since activation
TRequestStatus modifyStatus;
iFirstPrimaryPacketContext.ModifyActiveContext(modifyStatus);
//.........这里部分代码省略.........
示例5: TestStepResult
TVerdict CSimPacketGPRSRel99NotifyProfileChangeTest::doTestStepL()
{
INFO_PRINTF1(_L("BeginPacketGPRSRel99NotifyProfileChangeTest"));
CreateConfigFileL(_L("c:\\config3.txt"));
SetTestNumberL(6);
TRequestStatus gprsReqStatus, rel99ReqStatus;
TRequestStatus gprsNotifyStatus, rel99NotifyStatus;
// Open phone
TInt ret = iPhone.Open(iTelServer,KPhoneName);
INFO_PRINTF2(_L("Result: %d"),ret);
TESTL(ret == KErrNone);
INFO_PRINTF1(_L("Opened phone object"));
// Open GPRS packet service
TESTL(iGPRSPacketService.Open(iPhone)==KErrNone);
INFO_PRINTF1(_L("Opened Packet object"));
// Open GPRS context
TName contextName;
TName contextNameCompare;
TESTL(iGPRSPacketContext.OpenNewContext(iGPRSPacketService, contextName)==KErrNone);
contextNameCompare.Append(KSimPrimaryPacketContextName);
contextNameCompare.AppendNum(1);
TESTL(contextName.Compare(contextNameCompare)==KErrNone);
INFO_PRINTF1(_L("Opened Context object"));
// Open GPRS PacketQoS
TName gprsQosName;
TESTL(iGPRSPacketqos.OpenNewQoS(iGPRSPacketContext, gprsQosName)==KErrNone);
TName gprsQosNameCompare;
gprsQosNameCompare.Append(KSimPacketQosName);
gprsQosNameCompare.AppendNum(1);
TESTL(gprsQosName.Compare(gprsQosNameCompare)==KErrNone);
INFO_PRINTF1(_L("Opened GPRS QoS object"));
// Open UMTS Rel99 packet service - opened from same session RTelServer object as GPRS packet service
TESTL(iRel99PacketService.Open(iPhone)==KErrNone);
INFO_PRINTF1(_L("Opened Rel99 Packet object"));
// Open UMTS Rel99 context
TESTL(iRel99PacketContext.OpenExistingContext(iRel99PacketService, contextName) == KErrNone);
// Open Rel99 PacketQoS
TESTL(iRel99Packetqos.OpenExistingQoS(iRel99PacketContext, gprsQosName)==KErrNone);
INFO_PRINTF1(_L("Opened Rel99 QoS object"));
//Configure GPRS parameters
//
//
// Set GPRS QoS Profile Params
RPacketQoS::TQoSGPRSRequested aGPRSQoSReqConfig;
TPckg<RPacketQoS::TQoSGPRSRequested> aGPRSQoSReqPckg(aGPRSQoSReqConfig);
// post a GPRS notification
RPacketQoS::TQoSGPRSNegotiated aGPRSNotifyQoS;
TPckg<RPacketQoS::TQoSGPRSNegotiated> aGPRSNotifyQoSPckg(aGPRSNotifyQoS);
//GPRS Profile data
aGPRSQoSReqConfig.iMinDelay = RPacketQoS::EDelayClass1;
aGPRSQoSReqConfig.iMinMeanThroughput = RPacketQoS::EMeanThroughput200;
aGPRSQoSReqConfig.iMinPeakThroughput = RPacketQoS::EPeakThroughput16000;
aGPRSQoSReqConfig.iMinPrecedence = RPacketQoS::EPriorityLowPrecedence;
aGPRSQoSReqConfig.iMinReliability = RPacketQoS::EReliabilityClass1;
aGPRSQoSReqConfig.iReqDelay = RPacketQoS::EDelayClass2;
aGPRSQoSReqConfig.iReqMeanThroughput = RPacketQoS::EMeanThroughput2000;
aGPRSQoSReqConfig.iReqPeakThroughput = RPacketQoS::EPeakThroughput64000;
aGPRSQoSReqConfig.iReqPrecedence = RPacketQoS::EPriorityMediumPrecedence;
aGPRSQoSReqConfig.iReqReliability = RPacketQoS::EReliabilityClass2;
//
//
//Configure Rel99 QoS Profile Params
//
//
RPacketQoS::TQoSR99_R4Requested aR99QoSReqConfig;
TESTL(aR99QoSReqConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
TPckg<RPacketQoS::TQoSR99_R4Requested> aR99QoSReqPckg(aR99QoSReqConfig);
RPacketQoS::TQoSR99_R4Negotiated aR99NotifyQoS;
TPckg<RPacketQoS::TQoSR99_R4Negotiated> aR99NotifyQoSPckg(aR99NotifyQoS);
TInt req = 4;
TInt min = 2;
//Profile data
aR99QoSReqConfig.iReqTrafficClass = RPacketQoS::ETrafficClassStreaming; // 0x04
aR99QoSReqConfig.iMinTrafficClass = RPacketQoS::ETrafficClassConversational; // 0x02
aR99QoSReqConfig.iReqDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; // 0x04
aR99QoSReqConfig.iMinDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired; // 0x02
aR99QoSReqConfig.iReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired; // 0x08
aR99QoSReqConfig.iMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired; // 0x04
aR99QoSReqConfig.iReqMaxSDUSize = req; // 4
aR99QoSReqConfig.iMinAcceptableMaxSDUSize = min; // 2
aR99QoSReqConfig.iReqMaxRate.iUplinkRate = min; // between 0 - 1840
aR99QoSReqConfig.iReqMaxRate.iDownlinkRate = min;
//.........这里部分代码省略.........