Skip to main content

Implementation of a Finite State Machine with Active Libraries in C++

  • Chapter
Generative and Transformational Techniques in Software Engineering II (GTTSE 2007)

Abstract

Active libraries are code parts playing an active role during compilation. In C++ active libraries are implemented with the help of template metaprogramming (TMP) techniques. In this paper we present an active library designed as an implementation tool for Finite state machines. With the help of various TMP constructs, our active library carries out compile-time actions like optimizations via state-minimalization, and more sophisticated error-detection steps. Our library provides extended functionality to the Boost::Statechart library, the popular FSM implementation of the Boost library. We describe the implementation and analyze the efficiency.

Supported by GVOP-3.2.2.-2004-07-0005/3.0.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abrahams, D., Gurtovoy, A.: C++ template metaprogramming, Concepts, Tools, and Techniques from Boost and Beyond. Addison-Wesley, Boston (2004)

    Google Scholar 

  2. Alexandrescu, A.: Modern C++ Design: Generic Programming and Design Patterns Applied. Addison-Wesley, Reading (2001)

    Google Scholar 

  3. ANSI/ISO C++ Committee. Programming Languages – C++. ISO/IEC 14882:1998(E). American National Standards Institute (1998)

    Google Scholar 

  4. Boost Concept Checking library, http://www.boost.org/libs/concept_check/concept_check.html

  5. Boost Metaprogramming library, http://www.boost.org/libs/mpl/doc/index.html

  6. Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools and Applications. Addison-Wesley, Reading (2000)

    Google Scholar 

  7. Czarnecki, K., Eisenecker, U.W., Glck, R., Vandevoorde, D., Veldhuizen, T.L.: Generative Programmind and Active Libraries. Springer, Heidelberg (2000)

    Google Scholar 

  8. James, O.: Coplien: Curiously Recurring Template Patterns. C++ Report (February 1995)

    Google Scholar 

  9. Dnni, A.H.: Boost:Statechart, http://boost-sandbox.sourceforge.net/libs/statechart/doc/index.html

  10. Fajardo, V., Ohba, Y.: Open Diameter, http://www.opendiameter.org/

  11. Gil, Y., Lenz, K.: Simple and Safe SQL Queries with C++ Templates. In: Proceedings of the 6th international conference on Generative programming and component engineering, pp. 13–24, Salzburg, Austria (2007)

    Google Scholar 

  12. Gregor, D., Jrvi, J., Siek, J.G., Reis, G.D., Stroustrup, B., Lumsdaine, A.: Concepts: Linguistic Support for Generic Programming in C++. In: Proceedings of the 2006 ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA 2006) (October 2006)

    Google Scholar 

  13. Solodkyy, Y., Järvi, J., Mlaih, E.: Extending Type Systems in a Library — Type-safe XML processing in C++. In: Workshop of Library-Centric Software Design at OOPSLA 2006, Portland Oregon (2006)

    Google Scholar 

  14. Hopcroft, J.E., Motwani, R., Ullman, J.D.: Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, Reading (2000)

    MATH  Google Scholar 

  15. Juhász, Z.: Implementing Finite State Automata with Active Libraries M.Sc. Thesis. Budapest (2006)

    Google Scholar 

  16. Karlsson, B.: Beyond the C++ Standard Library, An Introduction to Boost. Addison-Wesley, Reading (2005)

    Google Scholar 

  17. Knuth, D.E.: An Empirical Study of FORTRAN Programs. Software - Practice and Experience 1, 105–133 (1971)

    Article  MATH  Google Scholar 

  18. McNamara, B., Smaragdakis, Y.: Static interfaces in C++. In: First Workshop on C++ Template Metaprogramming (October 2000)

    Google Scholar 

  19. Musser, D.R., Stepanov, A.A.: Algorithm-oriented Generic Libraries. Software-practice and experience 27(7), 623–642 (1994)

    Article  Google Scholar 

  20. Hopcroft, J.E., Motwani, R., Ullman, J.: Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, Reading (1969)

    MATH  Google Scholar 

  21. Programming languages C++, ISO/IEC 14882 (2003)

    Google Scholar 

  22. Samek, M.: Practical Statecharts in C/C++. CMP Books (2002)

    Google Scholar 

  23. Siek, J., Lumsdaine, A.: Concept checking: Binding parametric polymorphism in C++. In: First Workshop on C++ Template Metaprogramming (October 2000)

    Google Scholar 

  24. Siek, J.: A Language for Generic Programming. PhD thesis, Indiana University (August 2005)

    Google Scholar 

  25. Stroustrup, B.: The C++ Programming Language Special Edition. Addison-Wesley, Reading (2000)

    MATH  Google Scholar 

  26. Stroustrup, B.: The Design and Evolution of C++. Addison-Wesley, Reading (1994)

    Google Scholar 

  27. Unruh, E.: Prime number computation. ANSI X3J16-94-0075/ISO WG21-462

    Google Scholar 

  28. Vandevoorde, D., Josuttis, N.M.: C++ Templates: The Complete Guide. Addison-Wesley (2003)

    Google Scholar 

  29. Veldhuizen, T.L., Gannon, D.: Active libraries: Rethinking the roles of compilers and libraries. In: Proceedings of the SIAM Workshop on Object Oriented Methods for Inter-operable Scientic and Engineering Computing (OO 1998), pp. 21–23. SIAM Press, Philadelphia (1998)

    Google Scholar 

  30. Veldhuizen, T.: Five compilation models for C++ templates. In: First Workshop on C++ Template Metaprogramming (October 2000)

    Google Scholar 

  31. Veldhuizen, T.: Using C++ Template Metaprograms. C++ Report 7(4), 36–43 (1995)

    Google Scholar 

  32. Veldhuizen, T.: Expression Templates. C++ Report 7(5), 26–31 (1995)

    Google Scholar 

  33. Zólyomi, I., Porkoláb, Z.: Towards a template introspection library. In: Karsai, G., Visser, E. (eds.) GPCE 2004. LNCS, vol. 3286, pp. 266–282. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Juhász, Z., Sipos, Á., Porkoláb, Z. (2008). Implementation of a Finite State Machine with Active Libraries in C++. In: Lämmel, R., Visser, J., Saraiva, J. (eds) Generative and Transformational Techniques in Software Engineering II. GTTSE 2007. Lecture Notes in Computer Science, vol 5235. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-88643-3_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-88643-3_14

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-88642-6

  • Online ISBN: 978-3-540-88643-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics