Beispiel #1
0
void generateRdfTypeInfo(const ontology::Ontology& ontology) {
    std::ofstream oifs;
    createFile(RdfsEntity::outdir + "/RdfTypeInfo.h", &oifs);
    startInternal(oifs);
    generateCodeProtectorBegin(oifs, "", "RdfTypeInfo");
    oifs << "class RdfTypeInfo {" << std::endl;
    oifs << "public:" << std::endl;
    indent(oifs, 1) << "RdfTypeInfo();" << std::endl;
    oifs << std::endl;
    indent(oifs, 1) << "static const std::map<std::string, std::set<std::string> >& data() { return DATA; }" << std::endl;
    oifs << "private:" << std::endl;
    indent(oifs, 1) << "static std::map<std::string, std::set<std::string> > DATA;" << std::endl;
    oifs << "};" << std::endl;
    oifs << std::endl;
    generateCodeProtectorEnd(oifs, "", "RdfTypeInfo");
    stopInternal(oifs);

    std::ofstream ofs;
    createFile(RdfsEntity::outdir + "/RdfTypeInfo.cpp", &ofs);
    startInternal(ofs);
    addBoilerPlate(ofs);
    ofs << std::endl;
    ofs << "#include <map>" << std::endl;
    ofs << "#include <set>" << std::endl;
    ofs << "#include <string>" << std::endl;
    ofs << std::endl;
    if ( RdfsEntity::outdir == ".") {
        ofs << "#include \"RdfTypeInfo.h\"" << std::endl;
    } else {
        ofs << "#include \"" << RdfsEntity::outdir << "/RdfTypeInfo.h\"" << std::endl;
    }
    ofs << std::endl;
    for ( auto const& klassMapItem: ontology.classUri2Ptr()) {
        const Klass cls(*klassMapItem.second);
        ofs << "#include \"" << cls.genCppNameSpaceInclusionPath() << "/" << klassMapItem.second->prettyIRIName() << ".h" << "\"" << std::endl;
    }
    ofs << std::endl;

    ofs << "std::map<std::string, std::set<std::string> > RdfTypeInfo::DATA;" << std::endl;
    ofs << std::endl;
    ofs << "RdfTypeInfo::RdfTypeInfo() {" << std::endl;
    indent(ofs, 1) << "if ( DATA.empty() ) {" << std::endl;
    for ( auto const& klassMapItem: ontology.classUri2Ptr()) {
        const Klass& cls = *klassMapItem.second;
        indent(ofs, 2) << "DATA[\"" << klassMapItem.first << "\"] = " << cls.genCppNameSpaceFullyQualified() << "::" <<
                klassMapItem.second->prettyIRIName() << "::ancestorsRdfTypeIRI();" << std::endl;
    }
    indent(ofs, 1) << "};" << std::endl;
    ofs << std::endl;
    ofs << "}" << std::endl;
    ofs << std::endl;
    ofs << "namespace {" << std::endl;
    ofs << "RdfTypeInfo __loader;" << std::endl;
    ofs << "}" << std::endl;
    stopInternal(ofs);
}
void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& stream, unsigned readSize)
{
    if (readSize > 0) {
        m_hasRange = true;
        m_rangeStart = 0;
        m_rangeEnd = readSize - 1; // End is inclusive so (0,0) is a 1-byte read.
    }

    m_urlForReadingIsStream = true;
    startInternal(executionContext, &stream, 0);
}
Beispiel #3
0
		void StencilShader::start() {
			Renderer* r = ARK2D::getRenderer();
			if (r->isBatching()) {
				RendererBatchItem item;
				item.m_type = RendererBatchItem::TYPE_CUSTOM_OBJECT_FUNCTION;
				item.m_objectPointer = this;
				item.m_functionPointer = (void*) &startStatic;
				Renderer::s_batch->items.push_back(item);
				return;
			}
			startInternal();
		}
void AbstractMaemoRunControl::handleInitialCleanupFinished()
{
    if (m_stoppedByUser) {
        emit appendMessage(this, tr("Initial cleanup canceled by user."), false);
        emit finished();
    } else if (m_initialCleaner->hasError()) {
        handleError(tr("Error running initial cleanup: %1.")
                    .arg(m_initialCleaner->error()));
        emit finished();
    } else {
        emit appendMessage(this, tr("Initial cleanup done."), false);
        startInternal();
    }
}
Beispiel #5
0
void FileReaderLoader::start(ExecutionContext* executionContext, PassRefPtr<BlobDataHandle> blobData)
{
    ASSERT(executionContext);
    m_urlForReadingIsStream = false;
    startInternal(*executionContext, 0, blobData);
}
Beispiel #6
0
void VSThreadPool::start(const PFrameContext &context) {
    assert(context);
    std::lock_guard<std::mutex> l(lock);
    startInternal(context);
}
Beispiel #7
0
void VSThreadPool::start(const PFrameContext &context) {
    assert(context);
    std::lock_guard<std::mutex> l(lock);
    context->reqOrder = ++reqCounter;
    startInternal(context);
}
Beispiel #8
0
Process::ExecState Process::exec(const Path &command, const List<String> &a, const List<String> &environ,
                                 int timeout, unsigned flags)
{
    mMode = Sync;
    return startInternal(command, a, environ, timeout, flags);
}
Beispiel #9
0
Process::ExecState Process::exec(const Path &command, const List<String> &arguments, int timeout, unsigned flags)
{
    mMode = Sync;
    return startInternal(command, arguments, List<String>(), timeout, flags);
}
Beispiel #10
0
bool Process::start(const Path &command, const List<String> &a, const List<String> &environ)
{
    mMode = Async;
    return startInternal(command, a, environ) == Done;
}