C++ Boost

Boost Statechart 庫

(舊名 boost::fsm)

Overview 概覽

Contents 目錄

Overview 概覽
Supported platforms 支持的平台
Getting started 入門
Audience 讀者
Tutorial 指南 [pdf: English 英文, Japanese 日文]
UML to Boost.Statechart mapping summary UML到Boost.Statechart的映射概要
Frequently Asked Questions (FAQs) 常見問題
Configuration 配置
Definitions 定義
Reference 參考 [pdf: English 英文]
Rationale 原理 [pdf: English 英文]
Performance 性能
Acknowledgments 鳴謝
To-do list 待辦事項列表
Change history 變更歷史

Overview 概覽

Welcome to Boost.Statechart, a C++ library for finite state machines. Features include:
歡迎來到 Boost.Statechart,這是一個有限自動機的C++庫。其特性包括:

Supported platforms 支持的平台

Whether and how Boost.Statechart will work on your platform is best determined on the status page. If the cells in your compilers column are all green, the library should work as advertised. Cells of different color indicate possible problems; follow the links for details. Before employing the library I would also advise to run the tests (see Getting started) on your particular platform in all the modes (debug, release, etc.) that are later used during development (the status page shows debug mode results only). The closer the test compiler switches mirror the ones that are later used during development, the less likely are future surprises. An example of such a surprise is Intel 9.0 with MSVC 7.1 base toolset, where DllTestNormal and DllTestNative pass in debug mode but fail in release mode.
要判斷 Boost.Statechart 是否可以在你的平台上工作以及如何工作,最好的方法是查看 狀態頁。如果你所用的編譯器列中的格子全是綠色的,則該庫可以像所說的那樣正常工作。不同顏色的格子表示可能存在問題;具體請看相關鏈接。在使用本庫之前,我建議還應在你的特定平台上以所有在開發中要使用的模式(調試、發佈等)運行所有測試(狀 態頁中只列出了調試模式的結果)。測試時的編譯器開關與以後開發中所用的開關越接近,以後出現問題的可能性越小。這類問題的一個例子是,Intel 9.0 加 MSVC 7.1 基本工具集,其中的 DllTestNormal 和 DllTestNative 在調試模式通過了測試而在發佈模式下則失敗了。

Getting started 入門

  1. Follow the steps 1-4 described on the Boost Getting Started Page. Since Boost.Statechart is a header-only library, you should now know enough to compile the examples in the tutorial in your favorite environment (except PingPong which requires Boost.Thread binaries)  按照 Boost 入門頁 中所列的1-4步。由於 Boost.Statechart 是頭文件庫,你只需要在你喜歡的環境下編譯指南中的例子就可以了(除了 PingPong 的例子,它需要 Boost.Thread 的二進制庫)
  2. Optional: If you want to compile the PingPong example or use fifo_scheduler<> in your project, you need to get hold of the Boost.Thread binaries and link against them, see steps 5-6 on the Boost Getting Started Page 可選:如果你想編譯 PingPong 的例子,或者在你的工程中使用 fifo_scheduler<>,你就要得到 Boost.Thread 二進制庫並鏈接它們,請見 Boost 入門頁的5-6步。
  3. Optional: If you want to run the tests, you need to get the bjam executable, as described under step 5.2 on the Boost Getting Started Page. After doing so, bjam should be installed in your PATH. Open a command prompt and change the current directory to boost_1_34_0/libs/statechart/test. Type 可選:如果你想運行這些測試,你需要得到 bjam 可執行代碼,就像在 Boost 入門頁中的第5.2步中所寫的那樣。照做之後,bjam 將被安裝在你的 PATH 下。打開命令提示行並轉入目錄 boost_1_34_0/libs/statechart/test. 鍵入
    bjam --toolset=your-toolset

    (where your-toolset is one of the names documented under step 5.2.2 on the Boost Getting Started Page) and hit CR. After the test run, failures (if any) are indicated at the end of the output, in the form of  a "...failed updating X targets..." message. For some platforms certain failures are expected, see Supported platforms. (其中 your-toolset 是 Boost 入門頁的第5.2.2步中所列的名字之一),並打回車。測試運行之後,如果有失敗(任何失敗),將顯示在輸出的最後,信息形如 "...failed updating X targets..."。對於某些平台,確實存在一些特定的失敗信息,請見 被支持的平台

Audience 讀者

Throughout all Boost.Statechart documentation it is assumed that the reader is familiar with the state machine concept, UML statecharts and most of the UML state machine terminology. The following links might be interesting if this is not the case: 
在所有 Boost.Statechart 文檔中,均假設讀者熟悉狀態機概念、UML 狀態圖和多數 UML 狀態機術語。如果你不熟悉的話,以下鏈接可能對你有用:

Some of the used terminology cannot be found in the UML specifications, please see Definitions for more information.
有些用到的術語不在 UML 規格書中,更多信息請見 定義 一節。

Valid HTML 4.01 Transitional

Revised 09 April, 2007

Copyright © 2003-2007 Andreas Huber Dönni

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)