1 | /*
|
---|
2 | * TOPPERS Software
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems
|
---|
4 | *
|
---|
5 | * Copyright (C) 2007-2008 by TAKAGI Nobuhisa
|
---|
6 | * Copyright (C) 2010 by Meika Sugimoto
|
---|
7 | *
|
---|
8 | * 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
9 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
10 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
11 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
12 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
13 | * スコード中に含まれていること.
|
---|
14 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
15 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
16 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
17 | * の無保証規定を掲載すること.
|
---|
18 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
19 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
20 | * と.
|
---|
21 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
22 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
23 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
24 | * 報告すること.
|
---|
25 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
26 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
27 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
28 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
29 | * 免責すること.
|
---|
30 | *
|
---|
31 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
32 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
33 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
34 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
35 | * の責任を負わない.
|
---|
36 | *
|
---|
37 | */
|
---|
38 | /*!
|
---|
39 | * \file toppers/oil/factory.hpp
|
---|
40 | * \brief カーネルまたはモジュールに応じた処理オブジェクト生成に関する宣言定義
|
---|
41 | *
|
---|
42 | * このファイルで定義されるクラス
|
---|
43 | * \code
|
---|
44 | * class factory;
|
---|
45 | * \endcode
|
---|
46 | */
|
---|
47 | #ifndef TOPPERS_OIL_FACTORY_HPP_
|
---|
48 | #define TOPPERS_OIL_FACTORY_HPP_
|
---|
49 |
|
---|
50 | #include <memory>
|
---|
51 | #include <string>
|
---|
52 | #include <vector>
|
---|
53 | #include "toppers/macro_processor.hpp"
|
---|
54 | #include "toppers/oil/checker.hpp"
|
---|
55 | #include "toppers/oil/cfg1_out.hpp"
|
---|
56 |
|
---|
57 | namespace toppers
|
---|
58 | {
|
---|
59 | namespace oil
|
---|
60 | {
|
---|
61 | /*!
|
---|
62 | * \class factory factory.hpp "toppers/oil/factory.hpp"
|
---|
63 | * \brief カーネルまたはモジュールに応じた処理オブジェクト生成クラス
|
---|
64 | */
|
---|
65 | class factory
|
---|
66 | {
|
---|
67 | public:
|
---|
68 | explicit factory( std::string const& kernel );
|
---|
69 | virtual ~factory();
|
---|
70 | std::vector<std::string> const* get_object_definition_info() const;
|
---|
71 | cfg1_out::cfg1_def_table const* get_cfg1_def_table() const;
|
---|
72 | macro_processor::hook_t get_hook_on_assign() const { return do_get_hook_on_assign(); }
|
---|
73 | std::auto_ptr< cfg1_out > create_cfg1_out( std::string const& filename ) const
|
---|
74 | {
|
---|
75 | return do_create_cfg1_out( filename );
|
---|
76 | }
|
---|
77 | std::auto_ptr< checker > create_checker() const
|
---|
78 | {
|
---|
79 | return do_create_checker();
|
---|
80 | }
|
---|
81 | // std::auto_ptr< macro_processor > create_macro_processor( macro_processor::hook_t hook, cfg1_out const& cfg1out, cfg1_out::cfg_obj_map const& obj_def_map ) const
|
---|
82 | std::auto_ptr< macro_processor > create_macro_processor( cfg1_out const& cfg1out, cfg1_out::cfg_obj_map const& obj_def_map ) const
|
---|
83 | {
|
---|
84 | return do_create_macro_processor( this->get_hook_on_assign(), cfg1out, obj_def_map );
|
---|
85 | }
|
---|
86 | std::auto_ptr< macro_processor > create_macro_processor( cfg1_out const& cfg1out, std::vector< object_definition* > const& obj_array ) const
|
---|
87 | {
|
---|
88 | return do_create_macro_processor( this->get_hook_on_assign(), cfg1out, obj_array );
|
---|
89 | }
|
---|
90 | void swap( factory& other ) { do_swap( other ); }
|
---|
91 | protected:
|
---|
92 | virtual void do_swap( factory& other );
|
---|
93 | virtual macro_processor::hook_t do_get_hook_on_assign() const;
|
---|
94 | virtual std::auto_ptr< macro_processor > do_create_macro_processor( macro_processor::hook_t hook, cfg1_out const& cfg1out, cfg1_out::cfg_obj_map const& obj_def_map ) const;
|
---|
95 | virtual std::auto_ptr< macro_processor > do_create_macro_processor( macro_processor::hook_t hook, cfg1_out const& cfg1out, std::vector< object_definition* > const& obj_array ) const;
|
---|
96 | private:
|
---|
97 | virtual std::auto_ptr< cfg1_out > do_create_cfg1_out( std::string const& filename ) const;
|
---|
98 | virtual std::auto_ptr< checker > do_create_checker() const;
|
---|
99 |
|
---|
100 | std::string kernel_;
|
---|
101 | };
|
---|
102 |
|
---|
103 | }
|
---|
104 | }
|
---|
105 |
|
---|
106 | #endif // ! TOPPERS_OIL_FACTORY_HPP_
|
---|