当前位置: 首页>>代码示例>>C++>>正文


C++ ModuleDescriptor类代码示例

本文整理汇总了C++中ModuleDescriptor的典型用法代码示例。如果您正苦于以下问题:C++ ModuleDescriptor类的具体用法?C++ ModuleDescriptor怎么用?C++ ModuleDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ModuleDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addModule

    void ConnectedModules::addModule(const ModuleDescriptor& md, ConnectedModule* module) {
        Lock l(m_modulesMutex);

        // Store modules including identifier.
        stringstream sstr;
        sstr << md.getName() << "-" << md.getIdentifier();
        const string s = sstr.str();

        m_modules[s] = module;
    }
开发者ID:andriuskinas,项目名称:OpenDaVINCI,代码行数:10,代码来源:ConnectedModules.cpp

示例2: removeModule

    void ConnectedModules::removeModule(const ModuleDescriptor& md) {
        Lock l(m_modulesMutex);

        // Remove module including identifier.
        stringstream sstr;
        sstr << md.getName() << "-" << md.getIdentifier();
        const string s = sstr.str();

        m_modules.erase(s);
    }
开发者ID:andriuskinas,项目名称:OpenDaVINCI,代码行数:10,代码来源:ConnectedModules.cpp

示例3: hasModule

    bool ConnectedModules::hasModule(const ModuleDescriptor& md) {
        Lock l(m_modulesMutex);

        // Find module including identifier.
        stringstream sstr;
        sstr << md.getName() << "-" << md.getIdentifier();
        const string s = sstr.str();

        return (m_modules.count(s) != 0);
    }
开发者ID:andriuskinas,项目名称:OpenDaVINCI,代码行数:10,代码来源:ConnectedModules.cpp

示例4: __cudaRegisterTexture

GMAC_API void APICALL __cudaRegisterTexture(void **fatCubinHandle, const struct textureReference *hostVar,
		const void ** /*deviceAddress*/, const char *deviceName, int /*dim*/, int /*norm*/, int /*ext*/)
{
    TRACE(GLOBAL, "CUDA Texture");
	ModuleDescriptor *mod = (ModuleDescriptor *)fatCubinHandle;
	ASSERTION(mod != NULL);
	enterGmac();
    TextureDescriptor t = __impl::cuda::hpe::TextureDescriptor(deviceName, hostVar);
	mod->add(t);
	exitGmac();
}
开发者ID:GMAC-lib,项目名称:gmac,代码行数:11,代码来源:driver.cpp

示例5:

const char *ModuleDescriptor::GetName(uint16_t cid, uint16_t id)
{
    noname[0] = 0;
    ModuleDescriptor *m = ModuleDescriptor::Config[cid][id];

    if (m == NULL) {
        return noname;
    } else {
        return m->getName();
    }
}
开发者ID:sandsmark,项目名称:mBrane,代码行数:11,代码来源:module_descriptor.cpp

示例6: __cudaRegisterVar

GMAC_API void APICALL __cudaRegisterVar(void **fatCubinHandle, char *hostVar,
		char * deviceAddress, const char *deviceName, int /*ext*/, int /*size*/,
		int constant, int /*global*/)
{
    TRACE(GLOBAL, "CUDA Variable %s: %p", deviceName, deviceAddress);
	ModuleDescriptor *mod = (ModuleDescriptor *)fatCubinHandle;
	ASSERTION(mod != NULL);
	enterGmac();
    VariableDescriptor v = __impl::cuda::hpe::VariableDescriptor(deviceName, hostVar, bool(constant != 0));
    mod->add(v);
	exitGmac();
}
开发者ID:GMAC-lib,项目名称:gmac,代码行数:12,代码来源:driver.cpp

示例7: __cudaRegisterFunction

GMAC_API void APICALL __cudaRegisterFunction(
		void **fatCubinHandle, const char *hostFun, char * /*devFun*/,
		const char *devName, int /*threadLimit*/, uint3 * /*tid*/, uint3 * /*bid*/,
		dim3 * /*bDim*/, dim3 * /*gDim*/)
{
    TRACE(GLOBAL, "CUDA Function");
	ModuleDescriptor *mod = (ModuleDescriptor *)fatCubinHandle;
	ASSERTION(mod != NULL);
	enterGmac();
    KernelDescriptor k = __impl::core::hpe::KernelDescriptor(devName, (gmac_kernel_id_t) hostFun);
    mod->add(k);
	exitGmac();
}
开发者ID:GMAC-lib,项目名称:gmac,代码行数:13,代码来源:driver.cpp

示例8: onModuleUnload

void EdgeKiller::onModuleUnload(
        S2EExecutionState* state,
        const ModuleDescriptor &module
        )
{
    DECLARE_PLUGINSTATE(EdgeKillerState, state);

    //Remove all the polling entries that belong to the module
    EdgeKillerState::EdgeEntries &entries =
            plgState->getEntries();

    EdgeKillerState::EdgeEntries::iterator it1, it2;

    it1 = entries.begin();
    while(it1 != entries.end()) {
        const EdgeKillerState::Edge &e = *it1;
        if (module.Contains(e.source)) {
            it2 = it1;
            ++it2;
            entries.erase(it1);
            it1 = it2;
        }else {
            ++it1;
        }
    }
}
开发者ID:Bletchley13,项目名称:s2e-xyj,代码行数:26,代码来源:EdgeKiller.cpp

示例9: getConfiguration

    KeyValueConfiguration GlobalConfigurationProvider::getConfiguration(const ModuleDescriptor& md) {
        Lock l(m_configurationMutex);

        if ( (md.getName() == "Monitor") || (md.getName() == "Cockpit") ) {
            return m_configuration;
        }

        // Determine subset of configuration for this client.
        KeyValueConfiguration globalConfiguration = m_configuration.getSubsetForSection("global.");

        stringstream module;
        module << md.getName() << ".";
        KeyValueConfiguration privateConfigurationBasedOnModuleName = m_configuration.getSubsetForSection(module.str());

        KeyValueConfiguration privateConfigurationBasedOnModuleIdentifier;
        if (md.getIdentifier() != "") {
            stringstream moduleIdentifier;
            moduleIdentifier << md.getName() << ":" << md.getIdentifier() << ".";
            KeyValueConfiguration privateConfigurationBasedOnModuleIdentiferIncludingModuleIdentifier;
            privateConfigurationBasedOnModuleIdentiferIncludingModuleIdentifier = m_configuration.getSubsetForSection(moduleIdentifier.str());

            // Remove string ":" + md.getIdentifier().
            const vector<string> keys = privateConfigurationBasedOnModuleIdentiferIncludingModuleIdentifier.getListOfKeys();
            vector<string>::const_iterator it = keys.begin();
            stringstream moduleIdentifierPart;
            moduleIdentifierPart << ":" << md.getIdentifier() << ".";
            stringstream sstrPrivateConfigurationWithoutModuleIdentifier;
            while (it != keys.end()) {
                string key = (*it++);

                stringstream modifiedKey;
                modifiedKey << key.substr(0, key.find(moduleIdentifierPart.str())) << "." << key.substr(key.find(moduleIdentifierPart.str()) + moduleIdentifierPart.str().length());

                sstrPrivateConfigurationWithoutModuleIdentifier << modifiedKey.str() << "=" << privateConfigurationBasedOnModuleIdentiferIncludingModuleIdentifier.getValue<string>(key) << endl;
            }
            if (sstrPrivateConfigurationWithoutModuleIdentifier.str().length() > 0) {
                privateConfigurationBasedOnModuleIdentifier.readFrom(sstrPrivateConfigurationWithoutModuleIdentifier);
            }
        }

        // Prepare configuration.
        stringstream configurationForClient;
        globalConfiguration.writeTo(configurationForClient);
        configurationForClient << endl;

        privateConfigurationBasedOnModuleName.writeTo(configurationForClient);
        configurationForClient << endl;

        privateConfigurationBasedOnModuleIdentifier.writeTo(configurationForClient);
        configurationForClient << endl;

        KeyValueConfiguration clientKeyValueConfiguration;
        clientKeyValueConfiguration.readFrom(configurationForClient);

        // Set up configuration object.
        return clientKeyValueConfiguration;
    }
开发者ID:biddyweb,项目名称:OpenDaVINCI,代码行数:57,代码来源:GlobalConfigurationProvider.cpp

示例10: handleChangeState

    void SuperComponent::handleChangeState(const ModuleDescriptor& md, const coredata::dmcp::ModuleStateMessage::ModuleState &ms) {
        string state;
        switch (ms) {
            case coredata::dmcp::ModuleStateMessage::NOT_RUNNING: state = "NOT_RUNNING"; break;
            case coredata::dmcp::ModuleStateMessage::RUNNING: state = "RUNNING"; break;
            case coredata::dmcp::ModuleStateMessage::UNDEFINED_STATE: state = "UNDEFINED_STATE"; break;
        }

        CLOG1 << "[odsupercomponent]: Module " << md.toString() << " changed state to " << state << endl;

        if (m_modules.hasModule(md)) {
            m_modules.getModule(md)->setState(ms);
        }
    }
开发者ID:TacoVox,项目名称:OpenDaVINCI,代码行数:14,代码来源:SuperComponent.cpp

示例11: stricmp

void ModuleDescriptor::Init(uint8_t hostID)
{
    ModuleDescriptor *md;

    for (uint32_t i = 0; i < ModuleDescriptor::Config.count(); i++) // resolve host names into NID
        for (uint32_t j = 0; j < ModuleDescriptor::Config[i].count(); j++) {
            Node::Get()->trace(Node::EXECUTION) << "> Info: Module init '" << ModuleDescriptor::Config[i][j]->getName() << "' for host '" << ModuleDescriptor::Config[i][j]->hostName << "'" << std::endl;

            if (stricmp(ModuleDescriptor::Config[i][j]->hostName, Node::Get()->name()) == 0 ||
                    stricmp(ModuleDescriptor::Config[i][j]->hostName, "local") == 0) {
                md = ModuleDescriptor::Config[i][j];
                ModuleDescriptor::Main[hostID][i][j] = md;
                md->hostID = hostID;
                md->applyInitialProjections(hostID);

                if (md->module != NULL) {
                    md->module->_start();
                }

                ModuleDescriptor::Config[i][j] = NULL;
            }
        }
}
开发者ID:sandsmark,项目名称:mBrane,代码行数:23,代码来源:module_descriptor.cpp

示例12: disconnect

void FunctionMonitorState::disconnect(const ModuleDescriptor &desc, CallDescriptorsMap &descMap)
{
    CallDescriptorsMap::iterator it = descMap.begin();
    while (it != descMap.end()) {
        uint64_t addr = (*it).first;
        const CallDescriptor &call = (*it).second;
        if (desc.Contains(addr) && desc.Pid == call.pid) {
            CallDescriptorsMap::iterator it2 = it;
            ++it;
            descMap.erase(it2);
        }else {
            ++it;
        }
    }
}
开发者ID:Noah0701,项目名称:android_s2e,代码行数:15,代码来源:FunctionMonitor.cpp

示例13: handleConnectionLost

 void SuperComponent::handleConnectionLost(const ModuleDescriptor& md) {
     // This methods is called when a module terminates not properly.
     if (m_modules.hasModule(md)) {
         CLOG1 << "[odsupercomponent]: Connection to module " << md.toString() << " lost" << endl;
         ConnectedModule* module = m_modules.getModule(md);
         m_modules.removeModule(md);
         m_shutdownModules.addModule(md, module);
     }
     else {
         if (m_shutdownModules.hasModule(md)) {
             if (!m_shutdownModules.getModule(md)->hasExitCode()) {
                 clog << "[odsupercomponent]: Something went wrong...lost connection to module " << md.toString();
                 clog << ", module is in shutdownModule list but has not set an ExitCode." << endl;
             }
         }
     }
 }
开发者ID:TacoVox,项目名称:OpenDaVINCI,代码行数:17,代码来源:SuperComponent.cpp

示例14: handleExitCode

    void SuperComponent::handleExitCode(const ModuleDescriptor& md, const coredata::dmcp::ModuleExitCodeMessage::ModuleExitCode &me) {
        string exitcode;
        switch (me) {
            case coredata::dmcp::ModuleExitCodeMessage::OKAY: exitcode = "OKAY"; break;
            case coredata::dmcp::ModuleExitCodeMessage::EXCEPTION_CAUGHT: exitcode = "EXCEPTION_CAUGHT"; break;
            case coredata::dmcp::ModuleExitCodeMessage::SERIOUS_ERROR: exitcode = "SERIOUS_ERROR"; break;
            case coredata::dmcp::ModuleExitCodeMessage::CONNECTION_LOST: exitcode = "CONNECTION_LOST"; break;
            case coredata::dmcp::ModuleExitCodeMessage::NO_SUPERCOMPONENT: exitcode = "NO_SUPERCOMPONENT"; break;
            case coredata::dmcp::ModuleExitCodeMessage::UNDEFINED_EXITCODE: exitcode = "UNDEFINED_EXITCODE"; break;
        }

        CLOG1 << "[odsupercomponent]: Module " << md.toString() << " shutdown with exitcode " << exitcode << endl;

        if (m_modules.hasModule(md)) {
            ConnectedModule* module = m_modules.getModule(md);
            m_modules.removeModule(md);
            module->setExitCode();
            m_shutdownModules.addModule(md, module);
        }
    }
开发者ID:TacoVox,项目名称:OpenDaVINCI,代码行数:20,代码来源:SuperComponent.cpp

示例15: handleRuntimeStatistics

    void SuperComponent::handleRuntimeStatistics(const ModuleDescriptor& md, const coredata::dmcp::RuntimeStatistic& rs) {
        Lock l(m_moduleStatisticsMutex);

        ModuleStatistic entry(md, rs);
        m_moduleStatistics.putTo_MapOfModuleStatistics(md.getName(), entry);
    }
开发者ID:TacoVox,项目名称:OpenDaVINCI,代码行数:6,代码来源:SuperComponent.cpp


注:本文中的ModuleDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。