OpenRTM-aist 2.0.2
読み取り中…
検索中…
一致する文字列を見つけられません
RTC::ModuleManager クラス

モジュールマネージャクラス [詳解]

#include <ModuleManager.h>

RTC::ModuleManager 連携図

クラス

struct  DLLEntity
 DLL管理用構造体 [詳解]
 
class  DllPred
 ロード済みモジュールリスト [詳解]
 
struct  Error
 ファイル・オープン失敗例外処理用構造体 [詳解]
 
struct  FileNotFound
 指定ファイル不明例外処理用構造体 [詳解]
 
struct  InvalidArguments
 指定引数不正時例外処理用構造体 [詳解]
 
struct  InvalidOperation
 指定操作不正時例外処理用構造体 [詳解]
 
struct  ModuleNotFound
 指定モジュール不明例外処理用構造体 [詳解]
 
struct  NotAllowedOperation
 指定操作禁止時例外処理用構造体 [詳解]
 
struct  NotFound
 未実装部,指定モジュール不明例外処理用構造体 [詳解]
 
struct  SymbolNotFound
 指定シンボル不明例外処理用構造体 [詳解]
 
class  UnloadPred
 モジュールアンロードファンクタ [詳解]
 

公開型

using ModuleInitFunc = void (*)(Manager*)
 

公開メンバ関数

 ModuleManager (coil::Properties &prop)
 コンストラクタ
 
 ~ModuleManager ()
 デストラクタ
 
std::string load (const std::string &file_name)
 モジュールのロード
 
std::string load (const std::string &file_name, const std::string &init_func)
 モジュールのロード、初期化
 
void unload (const std::string &file_name)
 モジュールのアンロード
 
void unloadAll ()
 全モジュールのアンロード
 
void * symbol (const std::string &file_name, const std::string &func_name)
 モジュールのシンボルの参照
 
void setLoadpath (const std::vector< std::string > &load_path)
 モジュールロードパスを指定する
 
std::vector< std::string > getLoadPath ()
 モジュールロードパスを取得する
 
void addLoadpath (const std::vector< std::string > &load_path)
 モジュールロードパスを追加する
 
std::vector< coil::Properties > getLoadedModules ()
 ロード済みのモジュールリストを取得する
 
std::vector< coil::Properties > getLoadableModules ()
 ロード可能モジュールリストを取得する
 
void allowAbsolutePath ()
 モジュールの絶対パス指定許可
 
void disallowAbsolutePath ()
 モジュールの絶対パス指定禁止
 
void allowModuleDownload ()
 モジュールのURL指定許可
 
void disallowModuleDownload ()
 モジュールのURL指定禁止
 
std::string findFile (const std::string &fname, const std::vector< std::string > &load_path)
 LoadPath からのファイルの検索
 
bool fileExist (const std::string &filename)
 ファイルが存在するかどうかのチェック
 
std::string getInitFuncName (const std::string &file_path)
 初期化関数シンボルを生成する
 

限定公開型

using StringVector = std::vector<std::string>
 
using StringVectorItr = StringVector::iterator
 
using StringVectorConstItr = StringVector::const_iterator
 
using DllMap = std::vector<DLLEntity>
 
using DllMapItr = DllMap::iterator
 
using DllMapConstItr = DllMap::const_iterator
 

限定公開メンバ関数

void removeInvalidModules ()
 無効なモジュールプロファイルを削除する
 
void getModuleList (const std::string &lang, coil::vstring &modules)
 指定言語におけるロードパス上のローダブルなファイルリストを返す
 
void addNewFile (const std::string &fpath, coil::vstring &modules, const std::string &lang)
 キャッシュに無いパスだけmodulesに追加する
 
void getModuleProfiles (const std::string &lang, const coil::vstring &modules, vProperties &modprops)
 指定言語、ファイルリストからモジュールのプロパティを返す
 

限定公開変数類

Logger rtclog
 ロガーストリーム
 
coil::Properties & m_properties
 Module Manager プロパティ
 
ObjectManager< const char *, DLLEntity, DllPredm_modules
 ロード済みモジュールリスト
 
StringVector m_loadPath
 モジュール・ロード・パス・リスト
 
StringVector m_configPath
 コンフィギュレーション・パス・リスト
 
bool m_downloadAllowed
 モジュールURL指定許可フラグ
 
bool m_absoluteAllowed
 モジュール絶対パス指定許可フラグ
 
std::string m_initFuncSuffix
 初期実行関数サフィックス
 
std::string m_initFuncPrefix
 初期実行関数プリフィックス
 
coil::vstring m_supported_languages
 サポートするRTCの実装言語
 
vProperties m_modprofs
 
std::map< std::string, coil::vstring > m_loadfailmods
 

詳解

モジュールマネージャクラス

モジュールのロード、アンロードなどを管理するクラス

から
0.4.0

型定義メンバ詳解

◆ DllMap

using RTC::ModuleManager::DllMap = std::vector<DLLEntity>
protected

◆ DllMapConstItr

using RTC::ModuleManager::DllMapConstItr = DllMap::const_iterator
protected

◆ DllMapItr

using RTC::ModuleManager::DllMapItr = DllMap::iterator
protected

◆ ModuleInitFunc

◆ StringVector

using RTC::ModuleManager::StringVector = std::vector<std::string>
protected

◆ StringVectorConstItr

using RTC::ModuleManager::StringVectorConstItr = StringVector::const_iterator
protected

◆ StringVectorItr

using RTC::ModuleManager::StringVectorItr = StringVector::iterator
protected

構築子と解体子

◆ ModuleManager()

RTC::ModuleManager::ModuleManager ( coil::Properties & prop)
explicit

コンストラクタ

コンストラクタ。 設定された Property オブジェクト内の情報を基に初期化を実行する。

引数
prop初期化用プロパティ

◆ ~ModuleManager()

RTC::ModuleManager::~ModuleManager ( )

デストラクタ

関数詳解

◆ addLoadpath()

void RTC::ModuleManager::addLoadpath ( const std::vector< std::string > & load_path)

モジュールロードパスを追加する

指定されたパスリストを検索対象パスリストに追加する。

戻り値
load_path 追加モジュール検索対象パスリスト

◆ addNewFile()

void RTC::ModuleManager::addNewFile ( const std::string & fpath,
coil::vstring & modules,
const std::string & lang )
protected

キャッシュに無いパスだけmodulesに追加する

◆ allowAbsolutePath()

void RTC::ModuleManager::allowAbsolutePath ( )
inline

モジュールの絶対パス指定許可

ロード対象モジュールの絶対パス指定を許可するように設定する。

参照先 m_absoluteAllowed.

◆ allowModuleDownload()

void RTC::ModuleManager::allowModuleDownload ( )
inline

モジュールのURL指定許可

ロード対象モジュールのURL指定を許可する。 本設定が許可されている場合、モジュールをダウンロードしてロードすることが 許可される。

参照先 m_downloadAllowed.

◆ disallowAbsolutePath()

void RTC::ModuleManager::disallowAbsolutePath ( )
inline

モジュールの絶対パス指定禁止

ロード対象モジュールの絶対パス指定を禁止するように設定する。

参照先 m_absoluteAllowed.

◆ disallowModuleDownload()

void RTC::ModuleManager::disallowModuleDownload ( )
inline

モジュールのURL指定禁止

ロード対象モジュールのURL指定を禁止する。

参照先 m_downloadAllowed.

◆ fileExist()

bool RTC::ModuleManager::fileExist ( const std::string & filename)

ファイルが存在するかどうかのチェック

指定されたファイルが存在するか確認する。

引数
filename存在確認対象ファイル名
戻り値
ファイル存在確認結果(ファイルあり:true,なし:false)

◆ findFile()

std::string RTC::ModuleManager::findFile ( const std::string & fname,
const std::vector< std::string > & load_path )

LoadPath からのファイルの検索

指定されたパス内に、指定されたファイルが存在するか確認する。

引数
fname検索対象ファイル名
load_path検索先パスリスト
戻り値
検索されたファイル名

◆ getInitFuncName()

std::string RTC::ModuleManager::getInitFuncName ( const std::string & file_path)

初期化関数シンボルを生成する

初期化関数の名称を組み立てる。

引数
file_path初期化対象モジュール名称
戻り値
初期化関数名称組み立て結果

◆ getLoadableModules()

std::vector< coil::Properties > RTC::ModuleManager::getLoadableModules ( )

ロード可能モジュールリストを取得する

ロード可能なモジュールのリストを取得する。 (未実装)

戻り値
ロード可能モジュールリスト

◆ getLoadedModules()

std::vector< coil::Properties > RTC::ModuleManager::getLoadedModules ( )

ロード済みのモジュールリストを取得する

既にロード済みのモジュールリストを取得する。

戻り値
ロード済みモジュールリスト

◆ getLoadPath()

std::vector< std::string > RTC::ModuleManager::getLoadPath ( )
inline

モジュールロードパスを取得する

設定されているモジュールを検索対象パスリストを取得する。

戻り値
load_path モジュール検索対象パスリスト

参照先 m_loadPath.

◆ getModuleList()

void RTC::ModuleManager::getModuleList ( const std::string & lang,
coil::vstring & modules )
protected

指定言語におけるロードパス上のローダブルなファイルリストを返す

◆ getModuleProfiles()

void RTC::ModuleManager::getModuleProfiles ( const std::string & lang,
const coil::vstring & modules,
vProperties & modprops )
protected

指定言語、ファイルリストからモジュールのプロパティを返す

◆ load() [1/2]

std::string RTC::ModuleManager::load ( const std::string & file_name)

モジュールのロード

file_name をDLL もしくは共有ライブラリとしてロードする。 file_name は既定のロードパス (manager.modules.load_path) に対する 相対パスで指定する。

Property manager.modules.abs_path_allowed が yes の場合、 ロードするモジュールを絶対パスで指定することができる。
Property manager.modules.download_allowed が yes の場合、 ロードするモジュールをURLで指定することができる。

file_name は絶対パスで指定することができる。 manager.modules.abs_path_allowd が no の場合、 既定のモジュールロードパスから、file_name のモジュールを探しロードする。

引数
file_nameロード対象モジュール名
戻り値
指定したロード対象モジュール名

◆ load() [2/2]

std::string RTC::ModuleManager::load ( const std::string & file_name,
const std::string & init_func )

モジュールのロード、初期化

指定したファイルをDLL もしくは共有ライブラリとしてロードするとともに、 指定した初期化用オペレーションを実行する。

引数
file_nameロード対象モジュール名
init_func初期化処理用オペレーション
戻り値
指定したロード対象モジュール名

◆ removeInvalidModules()

void RTC::ModuleManager::removeInvalidModules ( )
protected

無効なモジュールプロファイルを削除する

◆ setLoadpath()

void RTC::ModuleManager::setLoadpath ( const std::vector< std::string > & load_path)

モジュールロードパスを指定する

モジュールロード時に対象モジュールを検索するパスを指定する。

引数
load_pathモジュール検索対象パスリスト

◆ symbol()

void * RTC::ModuleManager::symbol ( const std::string & file_name,
const std::string & func_name )

モジュールのシンボルの参照

◆ unload()

void RTC::ModuleManager::unload ( const std::string & file_name)

モジュールのアンロード

指定したロード済みモジュールをクローズし、アンロードする。

引数
file_nameアンロード対象モジュール名

◆ unloadAll()

void RTC::ModuleManager::unloadAll ( )

全モジュールのアンロード

全てのロード済みモジュールをアンロードする。

メンバ詳解

◆ m_absoluteAllowed

bool RTC::ModuleManager::m_absoluteAllowed
protected

モジュール絶対パス指定許可フラグ

参照元 allowAbsolutePath(), disallowAbsolutePath().

◆ m_configPath

StringVector RTC::ModuleManager::m_configPath
protected

コンフィギュレーション・パス・リスト

◆ m_downloadAllowed

bool RTC::ModuleManager::m_downloadAllowed
protected

モジュールURL指定許可フラグ

参照元 allowModuleDownload(), disallowModuleDownload().

◆ m_initFuncPrefix

std::string RTC::ModuleManager::m_initFuncPrefix
protected

初期実行関数プリフィックス

◆ m_initFuncSuffix

std::string RTC::ModuleManager::m_initFuncSuffix
protected

初期実行関数サフィックス

◆ m_loadfailmods

std::map<std::string, coil::vstring> RTC::ModuleManager::m_loadfailmods
protected

◆ m_loadPath

StringVector RTC::ModuleManager::m_loadPath
protected

モジュール・ロード・パス・リスト

参照元 getLoadPath().

◆ m_modprofs

vProperties RTC::ModuleManager::m_modprofs
protected

◆ m_modules

ObjectManager<const char*, DLLEntity, DllPred> RTC::ModuleManager::m_modules
protected

ロード済みモジュールリスト

◆ m_properties

coil::Properties& RTC::ModuleManager::m_properties
protected

Module Manager プロパティ

◆ m_supported_languages

coil::vstring RTC::ModuleManager::m_supported_languages
protected

サポートするRTCの実装言語

◆ rtclog

Logger RTC::ModuleManager::rtclog
protected

ロガーストリーム


このクラス詳解は次のファイルから抽出されました: