Nothing Special   »   [go: up one dir, main page]

Skip to main content

Using C++ Functors with Legacy C Libraries

  • Conference paper
Computational Science and Its Applications – ICCSA 2004 (ICCSA 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3046))

Included in the following conference series:

  • 958 Accesses

Abstract

The use of functors or function objects in the object oriented programming paradigm has proven to be useful in the design of scientific applications that need to tie functions and their execution context. However, a recurrent problem when using functors is their interaction with the callback mechanism of legacy C libraries. We review some of the solutions to this problem and present the design of a generic adapter that associates a C function pointer with function objects. This makes it possible to use an object-oriented style of programming and still interface with C libraries in a straightforward manner.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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.

Similar content being viewed by others

References

  1. Stroustrup, B.: The C++ programming language. Addison-Wesley, Reading (1997)

    Google Scholar 

  2. Barton, J., Nackman, L.: Scientific and engineering C++. Addison-Wesley, Reading (1994)

    Google Scholar 

  3. Hickey, R.: Callbacks in C++ Using Template Functors. C++ Report 7(2), 42–50 (1995)

    Google Scholar 

  4. Jakubic, P.: Callback Implementations in C++. In: 23rd Technology of Object- Oriented Languages (TOOLS23), Santa Barbara, CA, July 28-August 1, pp. 377–406. IEEE Computer Society Press, Los Alamitos (1997)

    Google Scholar 

  5. Ellis, M., Stroustrup, B.: The Annotated C++ Reference. Addison-Wesley, Reading (1990)

    Google Scholar 

  6. Haendel, L.: The function pointer tutorials, http://www.function-pointer.org

  7. Mensonides, P.: The Boost preprocessor library, http://www.boost.org/libs/

  8. Meyers, N.: Traits: A New and Useful Template Technique. C++ Report 7(5), 32–35 (1995)

    MathSciNet  Google Scholar 

  9. Alexandrescu, A.: Modern C++ Design. Addison-Wesley, Reading (2001)

    Google Scholar 

  10. Vandevoorde, D., Josuttis, N.: C++ templates. Pearson Education, London (2003)

    Google Scholar 

  11. Interop Systems Windows Services for UNIX, http://www.interix.com

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Broeckhove, J., Vanmechelen, K. (2004). Using C++ Functors with Legacy C Libraries. In: Laganá, A., Gavrilova, M.L., Kumar, V., Mun, Y., Tan, C.J.K., Gervasi, O. (eds) Computational Science and Its Applications – ICCSA 2004. ICCSA 2004. Lecture Notes in Computer Science, vol 3046. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24768-5_55

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24768-5_55

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22060-2

  • Online ISBN: 978-3-540-24768-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics