本文整理汇总了C++中GetModule函数的典型用法代码示例。如果您正苦于以下问题:C++ GetModule函数的具体用法?C++ GetModule怎么用?C++ GetModule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetModule函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModule
bool ModuleContainer::RemoveModule(uint32 itemID)
{
GenericModule * mod = GetModule(itemID);
if( mod == NULL )
return false; // NO module pointer found at this slot flag, DO NOT attempt to dereference
_removeModule(mod->flag(), mod);
//delete the module
delete mod;
mod = NULL;
return true;
}
示例2: PELOTON_ASSERT
llvm::Value *CodeGen::CallMulWithOverflow(llvm::Value *left, llvm::Value *right,
llvm::Value *&overflow_bit) {
PELOTON_ASSERT(left->getType() == right->getType());
llvm::Function *mul_func = llvm::Intrinsic::getDeclaration(
&GetModule(), llvm::Intrinsic::smul_with_overflow, left->getType());
// Perform the multiplication
llvm::Value *mul_result = CallFunc(mul_func, {left, right});
// Pull out the overflow bit from the resulting aggregate/struct
overflow_bit = GetBuilder().CreateExtractValue(mul_result, 1);
// Pull out the actual result of the subtraction
return GetBuilder().CreateExtractValue(mul_result, 0);
}
示例3: assert
bool CFlowGraphModuleManager::DeleteModuleXML( const char* moduleName )
{
if(m_ModulesPathInfo.empty())
return false;
TModulesPathInfo::iterator modulePathEntry = m_ModulesPathInfo.find(moduleName);
if (m_ModulesPathInfo.end() != modulePathEntry)
{
if(remove(modulePathEntry->second) == 0)
{
m_ModulesPathInfo.erase(moduleName);
// also remove module itself
TModuleIdMap::iterator idIt = m_ModuleIds.find(moduleName);
assert(idIt != m_ModuleIds.end());
TModuleId id = idIt->second;
TModuleMap::iterator modIt = m_Modules.find(id);
assert(modIt != m_Modules.end());
if(modIt != m_Modules.end() && idIt != m_ModuleIds.end())
{
for(CListenerSet<IFlowGraphModuleListener*>::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next() )
{
notifier->OnModuleDestroyed(GetModule(id));
}
m_Modules[id]->Destroy();
delete m_Modules[id];
m_Modules[id] = NULL;
m_ModuleIds.erase(idIt);
m_Modules.erase(modIt);
if (m_Modules.empty())
m_moduleIdMaker = 0;
for(CListenerSet<IFlowGraphModuleListener*>::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next() )
{
notifier->OnPostModuleDestroyed();
}
}
return true;
}
}
return false;
}
示例4: LoadDll
LibraryLoader* LoaderContainer::FindModule(const char* sName, const char* sCurrentDir, bool bLoadSymbols)
{
if (CURL::IsFullPath(sName))
{ // Has a path, just try to load
return LoadDll(sName, bLoadSymbols);
}
if (sCurrentDir)
{ // in the path of the parent dll?
std::string strPath = sCurrentDir;
strPath += sName;
LibraryLoader* pLoader = LoadDll(strPath.c_str(), bLoadSymbols);
if (pLoader)
return pLoader;
}
// in environment variable?
StringArray vecEnv;
StringUtils::SplitString(ENV_PATH, ";", vecEnv);
LibraryLoader* pDll = NULL;
for (int i = 0; i < (int)vecEnv.size(); ++i)
{
std::string strPath = vecEnv[i];
strPath += '/';
#ifdef LOGALL
LOGDEBUG("Searching for the dll %s in directory %s", sName, strPath.c_str());
#endif
strPath += sName;
// Have we already loaded this dll
if ((pDll = GetModule(strPath.c_str())) != NULL)
return pDll;
if ((pDll = LoadDll(strPath.c_str(), bLoadSymbols)) != NULL)
return pDll;
}
// can't find it in any of our paths - could be a system dll
if ((pDll = LoadDll(sName, bLoadSymbols)) != NULL)
return pDll;
LOGDEBUG("Dll %s was not found in path", sName);
return NULL;
}
示例5: OnModuleFinished
void CFlowGraphModuleManager::OnModuleFinished(TModuleId const& moduleId, TModuleInstanceId instanceId, bool bSuccess, TModuleParams const& params)
{
TModuleMap::iterator moduleEntry = m_Modules.find(moduleId);
if (m_Modules.end() != moduleEntry)
{
CFlowGraphModule *pModule = moduleEntry->second;
if (pModule)
{
for(CListenerSet<IFlowGraphModuleListener*>::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next() )
{
notifier->OnModuleInstanceDestroyed(GetModule(pModule->GetId()), instanceId);
}
pModule->DestroyInstance(instanceId, bSuccess, params);
}
}
}
示例6: clsLogAutoPtr
JEventBody* JModuleThread::MakeEventBody(JEVT_TYPE eType, JCHAR* pModName)
{
JEventBody* pEventBody = JNULL;
JModule* pModule = JNULL;
JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(),
JLOG_MOD_THREAD, "JModuleThread::MakeEventBody");
pModule = GetModule(pModName);
if (pModule)
{
pEventBody = pModule->MakeEventBody(static_cast<JUINT32>(eType));
}
return pEventBody;
}
示例7: GetModule
void FunctionInstance::Read(ModuleReader &reader, const MemberHeader &header)
{
// Read the function id.
uint32_t functionId;
reader >> functionId;
// Get the function.
Module *module = GetModule();
function = module->GetFunction(functionId);
// Read the generic instance
instance.Read(reader);
// Use the function generic prototype.
instance.SetPrototype(function->GetGenericPrototype());
}
示例8: GetModule
CExeModuleInstance* CRunningProcesses::GetProcessById(DWORD dwProcessId)
{
CExeModuleInstance* pResult = NULL;
CExeModuleInstance* pProcess;
for (DWORD i = 0; i < GetCount(); i++)
{
pProcess = static_cast<CExeModuleInstance*>( GetModule(i) );
if (pProcess->Get_ProcessId() == dwProcessId)
{
pResult = pProcess;
break;
} // if
} // for
return pResult;
}
示例9: TRACE_BEGIN
ErrorCode ComponentManager::LoadLibrary( const char *name )
{
TRACE_BEGIN( LOG_LVL_INFO );
IModule *mod = NULL;
ErrorCode result = kNoError;
LOG_NOTICE( "Opening Library: %s", name );
ErrorCode (*LoadLibrary)( IComponentManager *mgr );
IModule *(*GetModule)();
void *handle = dlopen( name, RTLD_LAZY );
if ( handle == NULL )
{
result = kLoadFailed;
LOG_WARN( "Failed to open shared lib \"%s\": %s", name, dlerror() );
}
else
{
LoadLibrary = (ErrorCode (*)(IComponentManager *mgr))dlsym( handle, "JHCOM_LibraryEntry" );
GetModule = (IModule *(*)())dlsym( handle, "JHCOM_GetModule" );
if ( GetModule == NULL || LoadLibrary == NULL )
{
result = kLoadFailed;
LOG_WARN( "Failed to get symbol" );
}
else
{
LOG( "LoadLibrary is %p", LoadLibrary );
LOG( "RegisterServices is %p", GetModule );
result = LoadLibrary( this );
if ( result == kNoError )
{
mod = GetModule();
mod->AddRef();
mod->loadComponents();
ModuleInfo *info = jh_new ModuleInfo( name, mod, handle );
mModules.push_back( info );
}
}
}
return result;
}
示例10: qDebug
void GadWorkspace::newObject(int index, int x, int y)
{
qDebug("GadWorksapce::newObject(%d, (%d,%d))\n", index, x, y);
if (!classNameMenu_)
return;
if (index < 0)
return;
qDebug(" className=%s\n name=%s\n",
(const char *) classNameMenu_[index].className,
(const char *) classNameMenu_[index].name);
GadModule *module = GetModule(*classDict_,
classNameMenu_[index].className,
classNameMenu_[index].name);
GadObject *obj = new GadObject(module, this);
obj->move(x, y);
obj->show();
resize();
}
示例11: text
void CException::ReportStd(ostream& out, TDiagPostFlags flags) const
{
string text(GetMsg());
string err_type(GetType());
err_type += "::";
err_type += GetErrCodeString();
SDiagMessage diagmsg(
GetSeverity(),
text.c_str(),
text.size(),
GetFile().c_str(),
GetLine(),
flags, NULL, 0, 0, err_type.c_str(),
GetModule().c_str(),
GetClass().c_str(),
GetFunction().c_str());
diagmsg.Write(out, SDiagMessage::fNoEndl | SDiagMessage::fNoPrefix);
}
示例12: LoadModuleGraph
void CFlowGraphModuleManager::LoadModuleGraph(const char* moduleName, const char* fileName)
{
// first check for existing module - must exist by this point
CFlowGraphModule *pModule = static_cast<CFlowGraphModule*>(GetModule(moduleName));
assert(pModule);
if(pModule)
{
if (pModule->LoadModuleGraph(moduleName, fileName))
{
for(CListenerSet<IFlowGraphModuleListener*>::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next() )
{
notifier->OnRootGraphChanged(pModule);
}
}
}
}
示例13: UpdateVersionsCombo
void CreateProjectDlg::UpdateVersionsCombo()
{
wxArrayString versions;
if ( Lua::Get().call( "getModuleVersions", GetModule().ToStdString() ) )
{
Helpers::PullTableOfStrings( versions );
}
mVersionsCombo->Clear();
if (versions.size() > 0)
{
mVersionsCombo->Append( versions );
mVersionsCombo->SetSelection(0);
}
mVersionsCombo->Enable(versions.size() > 0);
}
示例14: GetModule
llvm::GlobalVariable *Property::GetMemberInfo()
{
if(!propertyInfo)
{
// Only create the property info variable when reflection is enabled.
Module *module = GetModule();
if(!module->HasReflection())
return NULL;
// Get the property info class.
VirtualMachine *vm = module->GetVirtualMachine();
Class *propInfoClass = vm->GetPropertyInfoClass();
llvm::Module *targetModule = module->GetTargetModule();
propertyInfo = new llvm::GlobalVariable(*targetModule, propInfoClass->GetTargetType(),
false, ComputeMetadataLinkage(), NULL, GetMangledName() + "_propinfo_");
}
return propertyInfo;
}
示例15: LookupBuiltin
// Register the given function symbol and the LLVM function type it represents
llvm::Function *CodeGen::RegisterBuiltin(const std::string &fn_name,
llvm::FunctionType *fn_type,
void *func_impl) {
// Check if this is already registered as a built in, quit if to
auto *builtin = LookupBuiltin(fn_name);
if (builtin != nullptr) {
return builtin;
}
// TODO: Function attributes here
// Construct the function
auto *function = llvm::Function::Create(
fn_type, llvm::Function::ExternalLinkage, fn_name, &GetModule());
// Register the function in the context
code_context_.RegisterBuiltin(function, func_impl);
// That's it
return function;
}