int GroupAddrObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 10)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 10;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = type(); break;
        case 1: *reinterpret_cast< QString*>(_v) = description(); break;
        case 2: *reinterpret_cast< QString*>(_v) = groupAddr(); break;
        case 3: *reinterpret_cast< QString*>(_v) = value(); break;
        case 4: *reinterpret_cast< QString*>(_v) = tags(); break;
        }
        _id -= 5;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setType(*reinterpret_cast< int*>(_v)); break;
        case 1: setDescription(*reinterpret_cast< QString*>(_v)); break;
        case 2: setGroupAddr(*reinterpret_cast< QString*>(_v)); break;
        case 3: setValue(*reinterpret_cast< QString*>(_v)); break;
        case 4: setTags(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 5;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 5;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Esempio n. 2
0
NPT_Result SsdpConnector::start()
{
	if (m_started) {
		return NPT_ERROR_INVALID_STATE;
	}

	m_socket = new NPT_UdpMulticastSocket(NPT_SOCKET_FLAG_CANCELLABLE);
	m_socket->SetInterface(m_ifAddr);

	NPT_Result nr;

	nr = m_socket->Bind(NPT_SocketAddress(NPT_IpAddress::Any, 1900), true);
	if (NPT_FAILED(nr)) {
		delete m_socket;
		m_socket = NULL;
		return nr;
	}

	NPT_IpAddress groupAddr(239, 255, 255, 250);
	nr = m_socket->JoinGroup(groupAddr, m_ifAddr);
	if (NPT_FAILED(nr)) {
		delete m_socket;
		m_socket = NULL;
		return nr;
	}

	NPT_SocketInfo socketInfo;
	m_socket->GetInfo(socketInfo);
	m_port = socketInfo.local_address.GetPort();

	m_abortFlag = false;
	nr = NPT_Thread::Start();
	if (NPT_FAILED(nr)) {
		delete m_socket;
		m_socket = NULL;
		return nr;
	}

	m_started = true;
	return NPT_SUCCESS;
}