本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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;
}
}
}
示例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;
}
示例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);
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
}
示例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);
}
}
示例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);
}