void 
HippoBridgedIpcListenerImpl::userInfo(HippoEndpointId endpoint, const char *userId, const char *name, const char *smallPhotoUrl, const char *currentSong, const char *currentArtist, bool musicPlaying)
{
    HippoSerializedListener *serialized = new HippoSerializedListener();
    serialized->userInfo(endpoint, userId, name, smallPhotoUrl, currentSong, currentArtist, musicPlaying);

    invokeAsync((void *)serialized);
}
void 
HippoBridgedIpcListenerImpl::onMessage(HippoEndpointId endpoint, const char *chatId, const char *userId, const char *message, int sentiment, double timestamp, long serial)
{
    HippoSerializedListener *serialized = new HippoSerializedListener();
    serialized->onMessage(endpoint, chatId, userId, message, sentiment, timestamp, serial);

    invokeAsync((void *)serialized);
}
void 
HippoBridgedIpcListenerImpl::onUserLeave(HippoEndpointId endpoint, const char *chatId, const char *userId)
{
    HippoSerializedListener *serialized = new HippoSerializedListener();
    serialized->onUserLeave(endpoint, chatId, userId);

    invokeAsync((void *)serialized);
}
void
HippoBridgedIpcListenerImpl::onUserJoin(HippoEndpointId endpoint, const char *chatId, const char *userId, bool participant)
{
    HippoSerializedListener *serialized = new HippoSerializedListener();
    serialized->onUserJoin(endpoint, chatId, userId, participant);

    invokeAsync((void *)serialized);
}
void 
HippoBridgedIpcListenerImpl::onDisconnect()
{
    HippoSerializedListener *serialized = new HippoSerializedListener();
    serialized->onDisconnect();

    invokeAsync((void *)serialized);
}
Пример #6
0
void OsmAnd::Concurrent::Dispatcher::invoke(const Delegate method)
{
    assert(method != nullptr);

    QMutex waitMutex;
    QWaitCondition waitCondition;
    invokeAsync([&waitCondition, &waitMutex, method]
    {
        method();

        {
            QMutexLocker scopedLocker(&waitMutex);
            waitCondition.wakeAll();
        }
    });

    {
        QMutexLocker scopedLocker(&waitMutex);
        REPEAT_UNTIL(waitCondition.wait(&waitMutex));
    }
}