本文整理汇总了C++中Package::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ Package::getType方法的具体用法?C++ Package::getType怎么用?C++ Package::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Package
的用法示例。
在下文中一共展示了Package::getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processPackage
void AbstractHost::processPackage()
{
Package *constructedPackage = new Package(parseBuffer);
if(!constructedPackage->isValid())
{
sendPackage(constructAcknowledgementPackage(constructedPackage, "invalid"));
delete constructedPackage;
}
else if(!server->packageRouterInstance()->isAllowed(type, constructedPackage))
{
sendPackageAndDelete(constructAcknowledgementPackage(constructedPackage, "forbidden"));
delete constructedPackage;
}
else if(constructedPackage->getType() == ConnectionManagement)
{
updateNextPackageID(constructedPackage->getID());
handlePackage(constructedPackage);
}
else if(state == Established)
{
updateNextPackageID(constructedPackage->getID());
server->packageRouterInstance()->processPackage(this, constructedPackage);
}
else
{
sendPackage(constructAcknowledgementPackage(constructedPackage, "invalid"));
delete constructedPackage;
}
parseBuffer.clear();
}
示例2: main
//.........这里部分代码省略.........
for (iter1 = material.topPackages.begin(); iter1 != material.topPackages.end(); iter1++)
{
MaterialPackage* topPackage = *iter1;
// check operational pattern
if (!fcpxml && topPackage->op != OPERATIONAL_PATTERN_ATOM)
{
packagesToErase.push_back(topPackage);
continue;
}
// check package edit rate
Rational packageEditRate = getVideoEditRate(topPackage, material.packages);
if (packageEditRate != targetEditRate && packageEditRate != g_nullRational)
{
packagesToErase.push_back(topPackage);
continue;
}
// check video resolution IDs
vector<Track*>::const_iterator iter2;
for (iter2 = topPackage->tracks.begin(); iter2 != topPackage->tracks.end(); iter2++)
{
Track* track = *iter2;
SourcePackage dummy;
dummy.uid = track->sourceClip->sourcePackageUID;
PackageSet::iterator result = material.packages.find(&dummy);
if (result != material.packages.end())
{
Package* package = *result;
if (package->getType() != SOURCE_PACKAGE || package->tracks.size() == 0)
{
continue;
}
SourcePackage* sourcePackage = dynamic_cast<SourcePackage*>(package);
if (sourcePackage->descriptor->getType() != FILE_ESSENCE_DESC_TYPE)
{
continue;
}
FileEssenceDescriptor* fileDescriptor = dynamic_cast<FileEssenceDescriptor*>(
sourcePackage->descriptor);
if (fileDescriptor->videoResolutionID != 0 &&
fileDescriptor->videoResolutionID != videoResolutionID)
{
// material package has wrong video resolution
packagesToErase.push_back(topPackage);
break; // break out of track loop
}
}
}
}
vector<prodauto::MaterialPackage *>::const_iterator it;
for (it = packagesToErase.begin(); it != packagesToErase.end(); it++)
{
material.topPackages.erase(*it);
}
if (verbose)
{
if (packagesToErase.size() > 0)
{