本文整理汇总了C++中DviSubscription::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ DviSubscription::AddRef方法的具体用法?C++ DviSubscription::AddRef怎么用?C++ DviSubscription::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DviSubscription
的用法示例。
在下文中一共展示了DviSubscription::AddRef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Subscribe
TUint CpiDeviceDv::Subscribe(CpiSubscription& aSubscription, const OpenHome::Uri& /*aSubscriber*/)
{
Brh sid;
iDeviceDv.CreateSid(sid);
Brn tmp(sid);
Brh transfer(tmp);
aSubscription.SetSid(transfer);
TUint durationSecs = iDeviceCp->GetCpStack().Env().InitParams()->SubscriptionDurationSecs();
DviSubscription* subscriptionDv = new DviSubscription(iDeviceDv.GetDvStack(), iDeviceDv, *this, NULL, sid);
subscriptionDv->AddRef(); // guard against subscription expiring before client tries to renew or unsubscribe
iDeviceDv.GetDvStack().SubscriptionManager().AddSubscription(*subscriptionDv);
subscriptionDv->SetDuration(durationSecs);
iLock.Wait();
if (iSubscriptions.size() == 0) {
iShutdownSem.Wait(); // consume shutdown signal now the map is non-empty
}
Brn sid2(subscriptionDv->Sid());
Subscription* subscription = new Subscription(aSubscription, subscriptionDv);
iSubscriptions.insert(std::pair<Brn,Subscription*>(sid2, subscription));
iDeviceCp->AddRef();
iLock.Signal();
DviService* service = iDeviceDv.ServiceReference(aSubscription.ServiceType());
ASSERT(service != NULL);
service->AddSubscription(subscriptionDv);
service->RemoveRef();
return durationSecs;
}
示例2: QueueUpdate
void DviSubscriptionManager::QueueUpdate(DviSubscription& aSubscription)
{
aSubscription.AddRef();
iLock.Wait();
iList.push_back(&aSubscription);
Signal();
iLock.Signal();
}
示例3: AddSubscription
void DviSubscriptionManager::AddSubscription(DviSubscription& aSubscription)
{
iLock.Wait();
Brn sid(aSubscription.Sid());
iMap.insert(std::pair<Brn,DviSubscription*>(sid, &aSubscription));
aSubscription.AddRef();
iLock.Signal();
}
示例4: Find
DviSubscription* DviSubscriptionManager::Find(const Brx& aSid)
{
DviSubscription* subs = NULL;
iLock.Wait();
Brn sid(aSid);
Map::iterator it = iMap.find(sid);
if (it != iMap.end()) {
subs = it->second;
subs->AddRef();
}
iLock.Signal();
return subs;
}