3 * Toyohashi Open Platform for Embedded Real-Time Systems
5 * Copyright (C) 2007-2010 by TAKAGI Nobuhisa
7 * 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
8 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
9 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
10 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
11 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
13 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
14 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
15 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
17 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
18 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
20 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
21 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
22 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
24 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
25 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
26 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
27 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
30 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
31 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
32 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
33 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
38 * \file toppers/itronx/cfg1_out.hpp
39 * \brief cfg1_out.c/.srec ファイルを扱うための宣言定義
46 #ifndef TOPPERS_ITRONX_CFG1_OUT_HPP_
47 #define TOPPERS_ITRONX_CFG1_OUT_HPP_
52 #include "toppers/workaround.hpp"
53 #include "toppers/codeset.hpp"
54 #include "toppers/itronx/static_api.hpp"
59 class macro_processor;
67 * \class cfg1_out cfg1_out.hpp "toppers/itronx/cfg1_out.hpp"
68 * \brief cfg1_out.c/.srec ファイル管理クラス
77 std::string expression;
81 typedef std::map< std::string, std::vector< static_api > > static_api_map;
82 typedef std::vector< cfg1_def_t > cfg1_def_table;
84 explicit cfg1_out( std::string const& filename, cfg1_def_table const* def_table = 0 );
85 cfg1_out( cfg1_out const& other );
87 cfg1_out& operator = ( cfg1_out const& other )
94 void load_cfg( std::string const& input_file, codeset_t codeset, std::map< std::string, static_api::info > const& info_map );
95 void generate( char const* type = 0 ) const;
96 std::vector< static_api > const& get_static_api_array() const;
97 std::vector< std::pair< std::string, long > > const& get_domid_table() const;
98 std::vector< std::pair< std::string, long > > const& get_clsid_table() const;
99 std::string const& get_includes() const;
102 std::tr1::shared_ptr< s_record > get_srec() const;
103 std::tr1::shared_ptr< nm_symbol > get_syms() const;
104 cfg1_def_table const* get_def_table() const;
105 static_api_map merge() const;
106 bool is_little_endian() const;
108 void swap( cfg1_out& other )
110 implementation* t = pimpl_;
111 pimpl_ = other.pimpl_;
115 static std::tr1::int32_t make_signed( std::tr1::uint32_t value )
117 std::tr1::int32_t result;
118 if ( ( value >> 31 ) != 0 )
120 result = -static_cast< std::tr1::int32_t >( ( value ^ 0xffffffff ) + 1 ); // 2の補数表現にしか対応しない
124 result = static_cast< std::tr1::int32_t >( value );
129 static void load_id_input_file( std::map< std::string, std::pair< long, bool > >& id_map );
132 struct implementation;
133 explicit cfg1_out( implementation* pimpl ) : pimpl_( pimpl ) {}
135 implementation* pimpl_;
141 #endif // ! TOPPERS_ITRONX_CFG1_OUT_HPP_