本文整理汇总了C++中Endpoint::GetEndpointInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint::GetEndpointInfo方法的具体用法?C++ Endpoint::GetEndpointInfo怎么用?C++ Endpoint::GetEndpointInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Endpoint
的用法示例。
在下文中一共展示了Endpoint::GetEndpointInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
CAMIDIEndpoints::EndpointInfoList *CAMIDIEndpoints::GetEndpoints(EMode mode, UInt32 opts) {
EndpointList &srcList = (mode == kSources) ? mSources : mDestinations;
EndpointInfoList *list = new EndpointInfoList;
EndpointInfo info;
for (EndpointList::iterator it = srcList.begin(); it != srcList.end(); ++it) {
Endpoint *ept = *it;
if (ept->DriverOwned()) {
// driver-owned endpoint
if (ept->Next() == NULL) {
// nothing connected externally
if ((opts & kOptIncludeUnconnectedExternalPorts) || ept->EmbeddedOrVirtual()) {
if (ept->GetEndpointInfo(mode, info))
list->push_back(new EndpointInfo(info));
}
}
else if (opts & kOptCombineByPort) {
// add one item for all connected items
if (ept->GetEndpointInfo(mode, info))
list->push_back(new EndpointInfo(info));
}
// else it has external connections, which we'll pick up separately
}
else {
// external endpoint
if (!(opts & kOptCombineByPort)) {
if (ept->GetEndpointInfo(mode, info))
list->push_back(new EndpointInfo(info));
}
}
}
if (opts & kOptSortByName) {
std::sort(list->begin(), list->end(), CompareEndpointsByName());
}
return list;
}
示例2: FindEndpoint
bool CAMIDIEndpoints::FindEndpoint(EMode mode, EndpointInfo &info, UInt32 opts) {
EndpointList &srcList = (mode == kSources) ? mSources : mDestinations;
for (EndpointList::iterator it = srcList.begin(); it != srcList.end(); ++it) {
Endpoint *ept = *it;
if (ept->UniqueID() == info.mUniqueID) {
if (ept->GetEndpointInfo(mode, info))
return true;
break;
}
}
info.mSourceEndpoint = NULL;
info.mDestinationEndpoint = NULL;
return false;
}