⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cfg_factory.hpp

📁 FDMP the body of the kernel, the Information-Technology Promotion Agency (IPA) adopted by the unexpl
💻 HPP
字号:
/*
 *  TOPPERS/FDMP Kernel
 *      Toyohashi Open Platform for Embedded Real-Time Systems/
 *      Function Distributed Multiprocessor Kernel
 *
 *  Copyright (C) 2005 by Takagi Nobuhisa
 * 
 *  忋婰挊嶌尃幰偼丆埲壓偺 (1)乣(4) 偺忦審偐丆Free Software Foundation 
 *  偵傛偭偰岞昞偝傟偰偄傞 GNU General Public License 偺 Version 2 偵婰
 *  弎偝傟偰偄傞忦審傪枮偨偡応崌偵尷傝丆杮僜僼僩僂僃傾乮杮僜僼僩僂僃傾
 *  傪夵曄偟偨傕偺傪娷傓丏埲壓摨偠乯傪巊梡丒暋惢丒夵曄丒嵞攝晍乮埲壓丆
 *  棙梡偲屇傇乯偡傞偙偲傪柍彏偱嫋戻偡傞丏
 *  (1) 杮僜僼僩僂僃傾傪僜乕僗僐乕僪偺宍偱棙梡偡傞応崌偵偼丆忋婰偺挊嶌
 *      尃昞帵丆偙偺棙梡忦審偍傛傃壓婰偺柍曐徹婯掕偑丆偦偺傑傑偺宍偱僜乕
 *      僗僐乕僪拞偵娷傑傟偰偄傞偙偲丏
 *  (2) 杮僜僼僩僂僃傾傪丆儔僀僽儔儕宍幃側偳丆懠偺僜僼僩僂僃傾奐敪偵巊
 *      梡偱偒傞宍偱嵞攝晍偡傞応崌偵偼丆嵞攝晍偵敽偆僪僉儏儊儞僩乮棙梡
 *      幰儅僯儏傾儖側偳乯偵丆忋婰偺挊嶌尃昞帵丆偙偺棙梡忦審偍傛傃壓婰
 *      偺柍曐徹婯掕傪宖嵹偡傞偙偲丏
 *  (3) 杮僜僼僩僂僃傾傪丆婡婍偵慻傒崬傓側偳丆懠偺僜僼僩僂僃傾奐敪偵巊
 *      梡偱偒側偄宍偱嵞攝晍偡傞応崌偵偼丆師偺偄偢傟偐偺忦審傪枮偨偡偙
 *      偲丏
 *    (a) 嵞攝晍偵敽偆僪僉儏儊儞僩乮棙梡幰儅僯儏傾儖側偳乯偵丆忋婰偺挊
 *        嶌尃昞帵丆偙偺棙梡忦審偍傛傃壓婰偺柍曐徹婯掕傪宖嵹偡傞偙偲丏
 *    (b) 嵞攝晍偺宍懺傪丆暿偵掕傔傞曽朄偵傛偭偰丆TOPPERS僾儘僕僃僋僩偵
 *        曬崘偡傞偙偲丏
 *  (4) 杮僜僼僩僂僃傾偺棙梡偵傛傝捈愙揑傑偨偼娫愙揑偵惗偠傞偄偐側傞懝
 *      奞偐傜傕丆忋婰挊嶌尃幰偍傛傃TOPPERS僾儘僕僃僋僩傪柶愑偡傞偙偲丏
 * 
 *  杮僜僼僩僂僃傾偼丆柍曐徹偱採嫙偝傟偰偄傞傕偺偱偁傞丏忋婰挊嶌尃幰偍
 *  傛傃TOPPERS僾儘僕僃僋僩偼丆杮僜僼僩僂僃傾偵娭偟偰丆偦偺揔梡壜擻惈傕
 *  娷傔偰丆偄偐側傞曐徹傕峴傢側偄丏傑偨丆杮僜僼僩僂僃傾偺棙梡偵傛傝捈
 *  愙揑傑偨偼娫愙揑偵惗偠偨偄偐側傞懝奞偵娭偟偰傕丆偦偺愑擟傪晧傢側偄丏
 * 
 */

/*!
 *  \file   toppers/itron/cfg_factory.hpp
 *  \brief  JSP僇乕僱儖偺僐儞僼傿僊儏儗乕僞梡僼傽僋僩儕偵娭偡傞愰尵掕媊
 *
 *  偙偺僼傽僀儖偱掕媊偝傟傞僋儔僗
 *  \code
 *  class cfg_factory;
 *  \endcode
 */
#ifndef TOPPERS_ITRON_CFG_FACTORY_HPP_
#define TOPPERS_ITRON_CFG_FACTORY_HPP_

#include "toppers/itron/kernel_object.hpp"
#include "toppers/itron/cfg_contents.hpp"
#include "toppers/itron/kernel_chk.hpp"
#include "toppers/factory.hpp"

namespace toppers
{
  namespace itron
  {

    class static_api;

    /*!
     *  \class  cfg_factory cfg_factory.hpp "toppers/itron/cfg_factory.hpp"
     *  \brief  僐儞僼傿僊儏儗乕僞愱梡偺僼傽僋僩儕乕僋儔僗
     *  \image html class_diagram__cfg_factory.png
     */
    class cfg_factory : public factory
    {
    public:
      /*!
       *  \brief  僼傽儞僋僞惗惉娭悢傊偺億僀儞僞宆
       */
      typedef const boost::shared_ptr<cfg_factory> ( *builder_type )( const cmdline::option_array&, const std::string& );
      /*!
       *  \brief  奼挘弶婜壔僐乕僪惗惉娭悢傊偺億僀儞僞宆
       */
      typedef void ( *extra_initializer_type )( const kernel_cfg&, std::ostream& );

      cfg_factory( const cmdline::option_array& options, const std::string& version, long prid );

      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;
      const boost::shared_ptr<kernel_object> create_kernel_object( const static_api& api, std::vector<boost::shared_ptr<kernel_object> >& container );

      /*!
       *  \brief  kernel_object 僆僽僕僃僋僩偺惗惉娭悢孮偺庢摼
       *  \return kernel_object 僆僽僕僃僋僩傪奿擺偟偨儀僋僞傊偺僗儅乕僩億僀儞僞傪曉偡
       */
      const boost::shared_ptr<std::vector<kernel_object::builder_type> > get_kernel_object_builders() const { return do_get_kernel_object_builders(); }
      /*!
       *  \brief  僇乕僱儖僆僽僕僃僋僩柤乮"task"摍乯堦棗偺庢摼
       *  \return 僇乕僱儖僆僽僕僃僋僩柤偺儀僋僞傪巜偡僗儅乕僩億僀儞僞傪曉偡
       */
      const boost::shared_ptr<std::vector<std::string> > get_kernel_object_names() const { return do_get_kernel_object_names(); }
      /*!
       *  \brief  奼挘弶婜壔僐乕僪惗惉娭悢偺庢摼
       *  \return 奼挘弶婜壔僐乕僪惗惉娭悢傊偺億僀儞僞傪曉偡
       */
      extra_initializer_type get_extra_initializer() const { return do_get_extra_initializer(); }
      /*!
       *  \brief  僠僃僢僇乕忣曬僋儔僗偺惗惉
       *  \return kernel_chk 僋儔僗傊偺僗儅乕僩億僀儞僞傪曉偡
       */
      const boost::shared_ptr<kernel_chk> create_kernel_chk() const { return do_create_kernel_chk(); }
      /*!
       *  \brief  僾儘僟僋僩ID抣偺庢摼
       *  \return 僼傽僋僩儕惗惉帪偵巜掕偟偨僾儘僟僋僩ID抣傪曉偡
       */
      long prid() const { return prid_; }

      /*!
       *  \brief  僼傽僋僩儕偑強懏偡傞僐儞僥儞僣偺愝掕
       *  \param  contents  愝掕偡傞僐儞僥儞僣傊偺僗儅乕僩億僀儞僞
       */
      void set_contents( const boost::shared_ptr<cfg_contents>& contents ) { contents_ = contents; }
      /*!
       *  \brief  僼傽僋僩儕偑強懏偡傞僐儞僥儞僣偺庢摼
       *  \return 強懏偡傞僐儞僥儞僣傊偺僗儅乕僩億僀儞僞傪曉偡
       */
      const boost::shared_ptr<cfg_contents> get_contents() const { return contents_; }

      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;
      virtual const boost::shared_ptr<kernel_cfg> do_create_kernel_cfg( const std::string& file, const std::string& id_file ) const;
      virtual const boost::shared_ptr<std::vector<kernel_object::builder_type> > do_get_kernel_object_builders() const = 0;
      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;
    private:
      static std::vector<builder_type>& builders();
      static boost::shared_ptr<cfg_factory>& global_factory();

      boost::shared_ptr<cfg_contents> contents_;
      long prid_;
    };

  }
}

#endif  // ! TOPPERS_ITRON_CFG_FACTORY_HPP_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -