クラス toppers::itron::cfg_factory

コンフィギュレータ専用のファクトリークラス [詳細]

#include "toppers/itron/cfg_factory.hpp"

toppers::itron::cfg_factoryに対する継承グラフ

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

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

Public 型

typedef const boost::shared_ptr<
cfg_factory >(* 
builder_type )(const cmdline::option_array &, const std::string &)
 ファンクタ生成関数へのポインタ型
typedef void(* extra_initializer_type )(const kernel_cfg &, std::ostream &)
 拡張初期化コード生成関数へのポインタ型

Public メソッド

 cfg_factory (const cmdline::option_array &options, const std::string &version, long prid)
 コンストラクタ
const boost::shared_ptr< cfg_contentscreate_cfg_contents (text::const_iterator &next, text::const_iterator last, bool ucn=false, codeset_t codeset=ascii) const
const boost::shared_ptr< kernel_objectcreate_kernel_object (const static_api &api, std::vector< boost::shared_ptr< kernel_object > > &container)
 kernel_object の生成
const boost::shared_ptr< std::vector<
kernel_object::builder_type > > 
get_kernel_object_builders () const
 kernel_object オブジェクトの生成関数群の取得
const boost::shared_ptr< std::vector<
std::string > > 
get_kernel_object_names () const
 カーネルオブジェクト名("task"等)一覧の取得
extra_initializer_type get_extra_initializer () const
 拡張初期化コード生成関数の取得
const boost::shared_ptr< kernel_chkcreate_kernel_chk () const
 チェッカー情報クラスの生成
long prid () const
 プロダクトID値の取得
void set_contents (const boost::shared_ptr< cfg_contents > &contents)
 ファクトリが所属するコンテンツの設定
const boost::shared_ptr< cfg_contentsget_contents () const
 ファクトリが所属するコンテンツの取得

Static Public メソッド

static const boost::shared_ptr<
cfg_factory
build (const cmdline::option_array &options, const std::string &version=std::string())
 ファクトリ自体の生成
static void register_builder (builder_type builder)
 ファクトリ自体の生成関数の登録
static void clear_builders ()
 登録しているファクトリ生成関数の消去
static void global (const boost::shared_ptr< cfg_factory > &factory)
 グローバルファクトリの設定
static const boost::shared_ptr<
cfg_factory
global ()
 グローバルファクトリの参照

Protected メソッド

virtual const boost::shared_ptr<
cfg_contents
do_create_cfg_contents (text::const_iterator &next, text::const_iterator last, bool ucn, codeset_t codeset) const
virtual const boost::shared_ptr<
kernel_id
do_create_kernel_id (const std::string &file) const
 create_kernel_id から呼び出される実際の処理
virtual const boost::shared_ptr<
kernel_cfg
do_create_kernel_cfg (const std::string &file, const std::string &id_file) const
 create_kernel_cfg から呼び出される実際の処理
virtual const boost::shared_ptr<
std::vector< kernel_object::builder_type > > 
do_get_kernel_object_builders () const =0
 create_kernel_object 関数内で使用する生成関数群の取得
virtual const boost::shared_ptr<
std::vector< std::string > > 
do_get_kernel_object_names () const =0
virtual extra_initializer_type do_get_extra_initializer () const =0
virtual const boost::shared_ptr<
kernel_chk
do_create_kernel_chk () const =0

説明

コンフィギュレータ専用のファクトリークラス

class_diagram__cfg_factory.png

cfg_factory.hpp66 行で定義されています。


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

toppers::itron::cfg_factory::cfg_factory const cmdline::option_array options,
const std::string &  version,
long  prid
 

コンストラクタ

引数:
options コマンドラインオプション
version カーネルのバージョン文字列("JSP"等)
prid TKERNEL_PRID マクロの値

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

cfg_factory.cpp60 行で定義されています。

00061       : factory( options, version ), prid_( prid )
00062     {
00063     }


関数

const boost::shared_ptr< cfg_factory > toppers::itron::cfg_factory::build const cmdline::option_array options,
const std::string &  version = std::string()
[static]
 

ファクトリ自体の生成

引数:
options コマンドラインオプション
version バージョン文字列("JSP"等)
cfg_factory クラスはSingletonというわけではないため、普通にコンストラクタを呼び 出して生成することもできますが、 build 関数を使用することで、 register_builder 関数を用いて登録した生成関数の中から、コマンドラインオプションやバージョン に適合するクラスを選択して生成することができるようになります。

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

cfg_factory.cpp109 行で定義されています。

参照先 toppers::factory::options().

参照元 toppers::itron::fdmp::cfg_factory::build().

00110     {
00111       typedef std::vector<builder_type>::const_iterator const_iterator;
00112       for ( const_iterator iter( builders().begin() ), last( builders().end() ); iter != last; ++iter )
00113       {
00114         boost::shared_ptr<cfg_factory> ptr( ( *iter )( options, version ) );
00115         if ( ptr )
00116         {
00117           return ptr;
00118         }
00119       }
00120       return boost::shared_ptr<cfg_factory>();
00121     }

関数の呼び出しグラフ:

const boost::shared_ptr<kernel_chk> toppers::itron::cfg_factory::create_kernel_chk  )  const [inline]
 

チェッカー情報クラスの生成

戻り値:
kernel_chk クラスへのスマートポインタを返す

cfg_factory.hpp102 行で定義されています。

00102 { return do_create_kernel_chk(); }

const boost::shared_ptr< kernel_object > toppers::itron::cfg_factory::create_kernel_object const static_api api,
std::vector< boost::shared_ptr< kernel_object > > &  container
 

kernel_object の生成

引数:
api 静的API情報
container 生成した kernel_object の格納先
戻り値:
kernel_object へのスマートポインタ

cfg_factory.cpp76 行で定義されています。

参照先 do_get_kernel_object_builders().

00077     {
00078       boost::shared_ptr<std::vector<kernel_object::builder_type> > builders( do_get_kernel_object_builders() );
00079       std::vector<boost::shared_ptr<kernel_object> > t( container );
00080       boost::shared_ptr<kernel_object> ptr;
00081       typedef std::vector<kernel_object::builder_type>::const_iterator const_iterator;
00082 
00083       for ( const_iterator iter( builders->begin() ), last( builders->end() ); iter != last; ++iter )
00084       {
00085         ptr = ( **iter )( api, t );
00086         if ( !!ptr )
00087         {
00088           t.swap( container );
00089           return ptr;
00090         }
00091       }
00092       if ( !options()->find( "-iapi" ) )
00093       {
00094         error( api.line().file_.native_file_string(), api.line().line_, _( "static API `%1%\' cannot be unresolved" ) % api[0] );
00095       }
00096       return ptr;
00097     }

関数の呼び出しグラフ:

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

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

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

toppers::factoryを実装しています。

cfg_factory.cpp160 行で定義されています。

参照先 prid().

00161     {
00162       return boost::shared_ptr<kernel_cfg>( new cfg_kernel_cfg( file, id_file, prid() ) );
00163     }

関数の呼び出しグラフ:

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

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

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

toppers::factoryを実装しています。

cfg_factory.cpp155 行で定義されています。

00156     {
00157       return boost::shared_ptr<kernel_id>( new cfg_kernel_id( file ) );
00158     }

const boost::shared_ptr< std::vector< kernel_object::builder_type > > toppers::itron::cfg_factory::do_get_kernel_object_builders  )  const [protected, pure virtual]
 

create_kernel_object 関数内で使用する生成関数群の取得

戻り値:
生成関数群のベクターへのスマートポインタを返す

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

参照元 create_kernel_object()get_kernel_object_builders().

const boost::shared_ptr<cfg_contents> toppers::itron::cfg_factory::get_contents  )  const [inline]
 

ファクトリが所属するコンテンツの取得

戻り値:
所属するコンテンツへのスマートポインタを返す

cfg_factory.hpp118 行で定義されています。

参照元 toppers::itron::fdmp::cfg_factory::do_get_cfg_file_name().

00118 { return contents_; }

extra_initializer_type toppers::itron::cfg_factory::get_extra_initializer  )  const [inline]
 

拡張初期化コード生成関数の取得

戻り値:
拡張初期化コード生成関数へのポインタを返す

cfg_factory.hpp97 行で定義されています。

00097 { return do_get_extra_initializer(); }

const boost::shared_ptr<std::vector<kernel_object::builder_type> > toppers::itron::cfg_factory::get_kernel_object_builders  )  const [inline]
 

kernel_object オブジェクトの生成関数群の取得

戻り値:
kernel_object オブジェクトを格納したベクタへのスマートポインタを返す

cfg_factory.hpp87 行で定義されています。

参照先 do_get_kernel_object_builders().

00087 { return do_get_kernel_object_builders(); }

関数の呼び出しグラフ:

const boost::shared_ptr<std::vector<std::string> > toppers::itron::cfg_factory::get_kernel_object_names  )  const [inline]
 

カーネルオブジェクト名("task"等)一覧の取得

戻り値:
カーネルオブジェクト名のベクタを指すスマートポインタを返す

cfg_factory.hpp92 行で定義されています。

00092 { return do_get_kernel_object_names(); }

const boost::shared_ptr< cfg_factory > toppers::itron::cfg_factory::global  )  [static]
 

グローバルファクトリの参照

戻り値:
グローバルファクトリを指すスマートポインタを返す

cfg_factory.cpp178 行で定義されています。

参照元 toppers::itron::cfg_kernel_id::do_body()toppers::itron::cfg_kernel_cfg::do_body()toppers::itron::cfg_kernel_cfg::do_check_magic_number()toppers::itron::cfg_kernel_cfg::do_define_macros()toppers::itron::cfg_kernel_cfg::do_define_objects()toppers::itron::cfg_kernel_cfg::do_include_headers()toppers::itron::cfg_kernel_cfg::do_initialize_object()toppers::itron::cfg_kernel_cfg::do_initialize_other()toppers::itron::cfg_group::do_parse()toppers::itron::jsp::file_generator< task_policy >::generate_kernel_cfg().

00179     {
00180       return global_factory();
00181     }

void toppers::itron::cfg_factory::global const boost::shared_ptr< cfg_factory > &  factory  )  [static]
 

グローバルファクトリの設定

引数:
factory グローバル登録するファクトリへのスマートポインタ

cfg_factory.cpp169 行で定義されています。

00170     {
00171       global_factory() = factory;
00172     }

long toppers::itron::cfg_factory::prid  )  const [inline]
 

プロダクトID値の取得

戻り値:
ファクトリ生成時に指定したプロダクトID値を返す

cfg_factory.hpp107 行で定義されています。

参照元 do_create_kernel_cfg().

00107 { return prid_; }

void toppers::itron::cfg_factory::register_builder builder_type  builder  )  [static]
 

ファクトリ自体の生成関数の登録

引数:
builder 生成関数
この関数で登録した生成関数は build 関数から呼び出されます。

cfg_factory.cpp129 行で定義されています。

参照元 toppers::itron::fdmp::register_factory()toppers::itron::jsp::register_factory().

00130     {
00131       if ( builder != 0 )
00132       {
00133         builders().push_back( builder );
00134       }
00135     }

void toppers::itron::cfg_factory::set_contents const boost::shared_ptr< cfg_contents > &  contents  )  [inline]
 

ファクトリが所属するコンテンツの設定

引数:
contents 設定するコンテンツへのスマートポインタ

cfg_factory.hpp113 行で定義されています。

00113 { contents_ = contents; }


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