示例#1
0
int CountPorts()
{
	int count = 0;
	GetPorts(NULL, count, TRUE);
	return count;
}
示例#2
0
文件: code.cpp 项目: Astade/Astade
//~~ wxString GetPort(const wxString& portName) [AdeClass] ~~

wxString ret;
AdePorts* thePorts = GetPorts();

if (thePorts)
{
    for(AdeElementIterator it = thePorts->begin(); it != thePorts->end(); ++it)
    {
        AdeModelElement* anElement = it.CreateNewElement();
        wxASSERT(anElement);
        AdePort* aPort = dynamic_cast<AdePort*>(anElement);
        wxASSERT_MSG(aPort, "the ports folder should only contain ports");
        
        if (portName == aPort->GetName())
        {
            if (aPort->IsDelegate())
                ret = GetObjectPort(aPort->GetDelegationObject(), aPort->GetDelegationPort());
            else
                ret = portName;
        }
        
        delete anElement;
    }
    delete thePorts;
}

return ret;
示例#3
0
BOOL FillPortsArray(Port p[])
{
	int count = 0;
	return GetPorts(p, count, FALSE);
}