cfg_factory.hpp

説明を見る。
00001 /*
00002  *  TOPPERS/FDMP Kernel
00003  *      Toyohashi Open Platform for Embedded Real-Time Systems/
00004  *      Function Distributed Multiprocessor Kernel
00005  *
00006  *  Copyright (C) 2005 by Takagi Nobuhisa
00007  * 
00008  *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation 
00009  *  によって公表されている GNU General Public License の Version 2 に記
00010  *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
00011  *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
00012  *  利用と呼ぶ)することを無償で許諾する.
00013  *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
00014  *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
00015  *      スコード中に含まれていること.
00016  *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
00017  *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
00018  *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
00019  *      の無保証規定を掲載すること.
00020  *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
00021  *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
00022  *      と.
00023  *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
00024  *        作権表示,この利用条件および下記の無保証規定を掲載すること.
00025  *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
00026  *        報告すること.
00027  *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
00028  *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
00029  * 
00030  *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
00031  *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
00032  *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
00033  *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
00034  * 
00035  */
00036 
00046 #ifndef TOPPERS_ITRON_CFG_FACTORY_HPP_
00047 #define TOPPERS_ITRON_CFG_FACTORY_HPP_
00048 
00049 #include "toppers/itron/kernel_object.hpp"
00050 #include "toppers/itron/cfg_contents.hpp"
00051 #include "toppers/itron/kernel_chk.hpp"
00052 #include "toppers/factory.hpp"
00053 
00054 namespace toppers
00055 {
00056   namespace itron
00057   {
00058 
00059     class static_api;
00060 
00066     class cfg_factory : public factory
00067     {
00068     public:
00072       typedef const boost::shared_ptr<cfg_factory> ( *builder_type )( const cmdline::option_array&, const std::string& );
00076       typedef void ( *extra_initializer_type )( const kernel_cfg&, std::ostream& );
00077 
00078       cfg_factory( const cmdline::option_array& options, const std::string& version, long prid );
00079 
00080       const boost::shared_ptr<cfg_contents> create_cfg_contents( text::const_iterator& next, text::const_iterator last, bool ucn = false, codeset_t codeset = ascii ) const;
00081       const boost::shared_ptr<kernel_object> create_kernel_object( const static_api& api, std::vector<boost::shared_ptr<kernel_object> >& container );
00082 
00087       const boost::shared_ptr<std::vector<kernel_object::builder_type> > get_kernel_object_builders() const { return do_get_kernel_object_builders(); }
00092       const boost::shared_ptr<std::vector<std::string> > get_kernel_object_names() const { return do_get_kernel_object_names(); }
00097       extra_initializer_type get_extra_initializer() const { return do_get_extra_initializer(); }
00102       const boost::shared_ptr<kernel_chk> create_kernel_chk() const { return do_create_kernel_chk(); }
00107       long prid() const { return prid_; }
00108 
00113       void set_contents( const boost::shared_ptr<cfg_contents>& contents ) { contents_ = contents; }
00118       const boost::shared_ptr<cfg_contents> get_contents() const { return contents_; }
00119 
00120       static const boost::shared_ptr<cfg_factory> build( const cmdline::option_array& options, const std::string& version = std::string() );
00121       static void register_builder( builder_type builder );
00122       static void clear_builders();
00123       static void global( const boost::shared_ptr<cfg_factory>& factory );
00124       static const boost::shared_ptr<cfg_factory> global();
00125     protected:
00126       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;
00127       virtual const boost::shared_ptr<kernel_id> do_create_kernel_id( const std::string& file ) const;
00128       virtual const boost::shared_ptr<kernel_cfg> do_create_kernel_cfg( const std::string& file, const std::string& id_file ) const;
00129       virtual const boost::shared_ptr<std::vector<kernel_object::builder_type> > do_get_kernel_object_builders() const = 0;
00130       virtual const boost::shared_ptr<std::vector<std::string> > do_get_kernel_object_names() const = 0;
00131       virtual extra_initializer_type do_get_extra_initializer() const = 0;
00132       virtual const boost::shared_ptr<kernel_chk> do_create_kernel_chk() const = 0;
00133     private:
00134       static std::vector<builder_type>& builders();
00135       static boost::shared_ptr<cfg_factory>& global_factory();
00136 
00137       boost::shared_ptr<cfg_contents> contents_;
00138       long prid_;
00139     };
00140 
00141   }
00142 }
00143 
00144 #endif  // ! TOPPERS_ITRON_CFG_FACTORY_HPP_

Copyright © 2006 by TAKAGI Nobuhisa.
このページは Wed Apr 12 16:31:56 2006 に Doxygen によって生成されました。