Пример #1
0
void AbstractHttpChannel::sync(TransportType type)
{
    const auto& supportedTypes = getSupportedTransportTypes();
    auto it = supportedTypes.find(type);
    if (it == supportedTypes.end() || it->second == ChannelDirection::DOWN) {
        KAA_LOG_ERROR(boost::format("Channel [%1%] unsupported transport type '%2%'")
                                                        % getId()
                                                        % LoggingUtils::toString(type));
        return;
    }

    KAA_MUTEX_LOCKING("channelGuard_");
    KAA_MUTEX_UNIQUE_DECLARE(lock, channelGuard_);
    KAA_MUTEX_LOCKED("channelGuard_");

    if (!currentServer_) {
        KAA_LOG_WARN(boost::format("Channel [%1%] can't sync: server is null") % getId());
        return;
    }

    processTypes(std::map<TransportType, ChannelDirection>({ { type, it->second } })
#ifdef KAA_THREADSAFE
               , lock
#endif
                );

}
Пример #2
0
void LSCompiler::compileModules()
{
    for (UTsize i = 0; i < buildInfo->getNumModules(); i++)
    {
        ModuleBuildInfo *mbi = buildInfo->getModule(i);

        processTypes(mbi);

        for (UTsize j = 0; j < mbi->getNumSourceFiles(); j++)
        {
            utString        filename = mbi->getSourceFilename(j);
            CompilationUnit *cunit   = mbi->getCompilationUnit(filename);
            compileTypes(cunit);
        }
    }
}
Пример #3
0
void AbstractHttpChannel::syncAll()
{
    KAA_MUTEX_LOCKING("channelGuard_");
    KAA_MUTEX_UNIQUE_DECLARE(lock, channelGuard_);
    KAA_MUTEX_LOCKED("channelGuard_");

    if (!currentServer_) {
        KAA_LOG_WARN(boost::format("Channel [%1%] can't sync: server is null") % getId());
        return;
    }

    processTypes(getSupportedTransportTypes()
#ifdef KAA_THREADSAFE
               , lock
#endif
                );
}
Пример #4
0
preprocessResult processTypes (preprocessResult pr) {
    preprocessAux aux = pr.second;
    Node node = pr.first;
    if (node.type == TOKEN && aux.types.count(node.val))
        node = asn(aux.types[node.val], node, node.metadata);
    else if (node.val == "untyped")
        return preprocessResult(node.args[0], aux);
    else if (node.val == "outer")
        return preprocessResult(node, aux);
    else {
        for (unsigned i = 0; i < node.args.size(); i++) {
            node.args[i] =
                processTypes(preprocessResult(node.args[i], aux)).first;
        }
    }
    return preprocessResult(node, aux);
}
Пример #5
0
preprocessResult preprocess(Node n) {
    return processTypes(preprocessInit(n));
}