クラス toppers::factory

各オブジェクトのファクトリクラス [詳細]

#include "toppers/factory.hpp"

toppers::factoryに対する継承グラフ

Inheritance graph
[凡例]
toppers::factoryのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

Public 型

typedef void(* kernel_cfg_generator_type )(const kernel_cfg &, std::ostream &)
 kernel_cfg オブジェクトの生成関数へのポインタ型
typedef void(* kernel_id_generator_type )(const kernel_id &, std::ostream &)
 kernel_id オブジェクトの生成関数へのポインタ型

Public メソッド

 factory (const cmdline::option_array &options, const std::string &version)
 コンストラクタ
virtual ~factory ()
 デストラクタ
const boost::shared_ptr< kernel_idcreate_kernel_id () const
 kernel_idオブジェクトの生成
const boost::shared_ptr< kernel_cfgcreate_kernel_cfg () const
 kernel_cfgオブジェクトの生成
const boost::shared_ptr< std::vector<
kernel_cfg_generator_type > > 
create_kernel_cfg_generators () const
 kernel_cfg.c用の生成関数群の生成
const boost::shared_ptr< std::vector<
kernel_id_generator_type > > 
create_kernel_id_generators () const
 kernel_id.h用の生成関数群の生成
const boost::shared_ptr< cmdline::option_array > & options () const
 コマンドラインオプション
const std::string & version () const
 バージョン

Protected メソッド

const std::string get_cfg_file_name (const std::string &file) const
const std::string get_cfg_file_name (const std::string &option, const std::string &default_name) const
 設定ファイル名の取得
virtual const boost::shared_ptr<
kernel_id
do_create_kernel_id (const std::string &file) const =0
 create_kernel_id から呼び出される実際の処理
virtual const boost::shared_ptr<
kernel_cfg
do_create_kernel_cfg (const std::string &file, const std::string &id_file) const =0
 create_kernel_cfg から呼び出される実際の処理
virtual const boost::shared_ptr<
std::vector< kernel_cfg_generator_type > > 
do_create_kernel_cfg_generators () const =0
 create_kernel_cfg_generators から呼び出される実際の処理
virtual const boost::shared_ptr<
std::vector< kernel_id_generator_type > > 
do_create_kernel_id_generators () const =0
 create_kernel_id_generators から呼び出される実際の処理
virtual const std::string do_get_cfg_file_name (const std::string &file) const
 設定ファイル名の取得

Static Protected メソッド

static void create_sub_directory (const std::string &dir)
 サブディレクトリの作成

説明

各オブジェクトのファクトリクラス

factory.hpp64 行で定義されています。


コンストラクタとデストラクタ

toppers::factory::factory const cmdline::option_array options,
const std::string &  version
 

コンストラクタ

引数:
options コマンドラインオプション
version バージョン文字列

factory.cpp55 行で定義されています。

00056     : options_( new cmdline::option_array( options ) ), version_( version )
00057   {
00058   }


関数

const boost::shared_ptr< kernel_cfg > toppers::factory::create_kernel_cfg  )  const
 

kernel_cfgオブジェクトの生成

戻り値:
kernel_cfgのインスタンスを指すスマートポインタを返す

factory.cpp73 行で定義されています。

参照先 do_create_kernel_cfg()get_cfg_file_name().

00074   {
00075     std::string file( get_cfg_file_name( "-cfg", "kernel_cfg.c" ) );
00076 
00077     // get_cfg_file_name を使うと、-nオプションによるディレクトリ名が付随してくるので、
00078     // ここでは使用できない
00079     std::string id_file( "kernel_id.h" );
00080     options_->find( "-id", id_file );
00081 
00082     return do_create_kernel_cfg( file, id_file );
00083   }

関数の呼び出しグラフ:

const boost::shared_ptr< std::vector< factory::kernel_cfg_generator_type > > toppers::factory::create_kernel_cfg_generators  )  const
 

kernel_cfg.c用の生成関数群の生成

戻り値:
kernel_cfg.c用の生成関数群を指すスマートポインタを返す

factory.cpp89 行で定義されています。

参照先 do_create_kernel_cfg_generators().

00090   {
00091     return do_create_kernel_cfg_generators();
00092   }

関数の呼び出しグラフ:

const boost::shared_ptr< kernel_id > toppers::factory::create_kernel_id  )  const
 

kernel_idオブジェクトの生成

戻り値:
kernel_idのインスタンスを指すスマートポインタを返す

factory.cpp64 行で定義されています。

参照先 do_create_kernel_id()get_cfg_file_name().

00065   {
00066     return do_create_kernel_id( get_cfg_file_name( "-id", "kernel_id.h" ) );
00067   }

関数の呼び出しグラフ:

const boost::shared_ptr< std::vector< factory::kernel_id_generator_type > > toppers::factory::create_kernel_id_generators  )  const
 

kernel_id.h用の生成関数群の生成

戻り値:
kernel_id.h用の生成関数群を指すスマートポインタを返す

factory.cpp98 行で定義されています。

参照先 do_create_kernel_id_generators().

00099   {
00100     return do_create_kernel_id_generators();
00101   }

関数の呼び出しグラフ:

void toppers::factory::create_sub_directory const std::string &  dir  )  [static, protected]
 

サブディレクトリの作成

引数:
dir サブディレクトリのパス名

factory.cpp168 行で定義されています。

参照先 _rout.

参照元 do_get_cfg_file_name().

00169   {
00170     boost::filesystem::path path( dir, boost::filesystem::native );
00171     if ( exists( path ) )
00172     {
00173       if ( !is_directory( path ) )
00174       {
00175         rout.error( _( "%1% is not directory" ) % path.string() );
00176       }
00177     }
00178     else
00179     {
00180       try
00181       {
00182         create_directory( path );
00183       }
00184       catch ( boost::filesystem::filesystem_error& )
00185       {
00186         rout.error( _( "cannot make directory `%1%\'" ) % path.string() );
00187       }
00188     }
00189   }

const boost::shared_ptr< kernel_cfg > toppers::factory::do_create_kernel_cfg const std::string &  file,
const std::string &  id_file
const [protected, pure virtual]
 

create_kernel_cfg から呼び出される実際の処理

戻り値:
kernel_cfg のインスタンスを指すスマートポインタを返す

toppers::itron::cfg_factoryで実装されています。

参照元 create_kernel_cfg().

const boost::shared_ptr< std::vector< kernel_cfg_generator_type > > toppers::factory::do_create_kernel_cfg_generators  )  const [protected, pure virtual]
 

create_kernel_cfg_generators から呼び出される実際の処理

戻り値:
kernel_cfg.c用の生成関数群を指すスマートポインタを返す

toppers::itron::specified_factory< Policy >toppers::itron::fdmp::cfg_factoryで実装されています。

参照元 create_kernel_cfg_generators().

const boost::shared_ptr< kernel_id > toppers::factory::do_create_kernel_id const std::string &  file  )  const [protected, pure virtual]
 

create_kernel_id から呼び出される実際の処理

戻り値:
kernel_id のインスタンスを指すスマートポインタを返す

toppers::itron::cfg_factoryで実装されています。

参照元 create_kernel_id().

const boost::shared_ptr< std::vector< kernel_id_generator_type > > toppers::factory::do_create_kernel_id_generators  )  const [protected, pure virtual]
 

create_kernel_id_generators から呼び出される実際の処理

戻り値:
kernel_id.h用の生成関数群を指すスマートポインタを返す

toppers::itron::specified_factory< Policy >toppers::itron::fdmp::cfg_factoryで実装されています。

参照元 create_kernel_id_generators().

const std::string toppers::factory::do_get_cfg_file_name const std::string &  file  )  const [protected, virtual]
 

設定ファイル名の取得

引数:
file ファイル名
戻り値:
設定ファイル名を返す

toppers::itron::fdmp::cfg_factoryで再定義されています。

factory.cpp148 行で定義されています。

参照先 create_sub_directory().

参照元 get_cfg_file_name().

00149   {
00150     boost::filesystem::path file_name( file, boost::filesystem::native );
00151     if ( !file_name.has_root_path() )
00152     {
00153       std::string dir_name;
00154       if ( options_->find( "-n", dir_name ) && !dir_name.empty() )
00155       {
00156         create_sub_directory( dir_name );
00157         boost::filesystem::path dir( dir_name, boost::filesystem::native );
00158         file_name = dir/file_name;
00159       }
00160     }
00161     return file_name.native_file_string();
00162   }

関数の呼び出しグラフ:

const std::string toppers::factory::get_cfg_file_name const std::string &  option,
const std::string &  default_name
const [protected]
 

設定ファイル名の取得

引数:
option ファイル名を指定するオプション名(ex. "-cfg=")
default_name オプションによる指定がない場合の既定名
戻り値:
設定ファイル名を返す
`kernel_id.h'や`kernel_cfg.c'などの設定ファイル(出力ファイル)の名称を取得します。 設定ファイル名はコマンドラインオプションによって直接指定できるほか、出力ディレクトリが 指定されることでファイル名(パス名)が変わります。
この関数では、それらを反映した設定ファイル名を返します。

factory.cpp132 行で定義されています。

00133   {
00134     std::string file;
00135     options_->find( option, file );
00136     if ( file.empty() )
00137     {
00138       file = default_name;
00139     }
00140     return get_cfg_file_name( file );
00141   }

const boost::shared_ptr< cmdline::option_array > & toppers::factory::options  )  const
 

コマンドラインオプション

戻り値:
コマンドラインオプションを返す

factory.cpp107 行で定義されています。

参照元 toppers::itron::specified_factory< Policy >::build()toppers::itron::fdmp::cfg_factory::build()toppers::itron::cfg_factory::build().

00108   {
00109     return options_;
00110   }

const std::string & toppers::factory::version  )  const
 

バージョン

戻り値:
バージョンを返す

factory.cpp116 行で定義されています。

00117   {
00118     return version_;
00119   }


このクラスの説明は次のファイルから生成されました:
Copyright © 2006 by TAKAGI Nobuhisa.
このページは Wed Apr 12 16:32:03 2006 に Doxygen によって生成されました。