• Gem #116: Ada and C++ Exceptions

    One of the main issues raised by interfacing Ada and C++ is propagation of exceptions from one environment to the other. In this Gem, we’ll demonstrate how the new exception mechanism implemented in GNAT allows catching Ada exceptions in C++, and vice versa. Note that the following code will work starting with GNAT Pro 7. Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #115: Lego Mindstorms Ada Environment — Part 2

    This series of Gems explores the GNAT Ada programming environment for the Lego Mindstorms robotics kit. The series examines the high- and low-level interfaces to the hardware, the language subset supported by the underlying run-time library, and how to use the environment effectively. We’ll examine other topics as well. This Gem introduces the basic steps of the Mindstorms hardware initialization and shutdown. Continue Reading »

    Pat Rogers
    AdaCore
  • Gem #114: Logging with GNATCOLL.Traces

    The GNAT Components Collection provides a package with facilities for logging information to various text files. Extra information can be output for each log, providing convenient ways to understand the behavior of an application when a debugger is not available. Continue Reading »

  • Gem #113: Visitor Pattern in Ada

    The visitor pattern is a design pattern that provides a way to execute specific methods on an object (the visitor) depending on the type of another object. Since the exact subprogram called depends on both types of the objects, this pattern is often called double dispatching. Continue Reading »

  • Gem #112: Lego Mindstorms Ada Environment—Part 1

    This series of Gems explores the GNAT Ada programming environment for the Lego Mindstorms robotics kit. The series will examine the high- and low-level interfaces to the hardware, the language subset supported by the underlying run-time library, and how to use the environment effectively. We’ll examine other topics as well. This first Gem introduces the general issue of the Ada language subset available to programmers and shows how the Ada interfaces address one specific aspect of that subset. Continue Reading »

    Pat Rogers
    AdaCore
  • Gem #111: The Distributed Systems Annex, Part 5—Embedded Name Server

    This is the fifth in a series of Gems introducing the facilities defined by the optional annex for Distributed Systems of the Ada Reference Manual (Annex E). In the previous installment, we showed how to integrate DSA code as a stand-alone Ada library in a C/C++ application.

    In this installment, we show how the DSA name server can be embedded in the main partition, rather than started as a stand-alone process.

    Continue Reading »

    Thomas Quinot
    AdaCore
  • Gem #110: Ada Plug-ins and Shared Libraries—Part 2

    In this Gem, we continue the discussion of GNAT's support for shared libraries and explain how to build Ada plug-ins. Continue Reading »

    Pascal Obry
    EDF R&D
  • Gem #109: Ada Plug-ins and Shared Libraries—Part 1

    In this Gem, we discuss GNAT's support for shared libraries as a prelude to understanding how to build Ada plug-ins. Continue Reading »

    Pascal Obry
    EDF R&D
  • Gem #108: Gprbuild and Configuration Files—Part 2

    In this second of a series of three Gems about gprbuild, we explain in more detail how to configure the tool, again with the help of configuration files.

    Continue Reading »

    Johannes Kanig
    AdaCore
  • Gem #107: Preventing Deallocation for Reference-counted Types

    This Gem was contributed by Ada Magica (C.K.W. Grein), as a followup to an earlier Gem. Christoph explores ways in which the API for reference-counted types can be made safer by taking advantage of some Ada 2005 features.

    Continue Reading »

    Ada Magica
    C.K.W. Grein
  • Gem #106: Lady Ada Kisses Python—Part 2

    This series of two Gems explains how to use the GNAT Components Collection to interface your Ada code with Python. The first Gem described what benefits this could bring to your application, and the difficulties there would be in interfacing directly to the Python library. The second Gem shows how to get started with GNATCOLL to make the interfacing much easier.

    Continue Reading »

  • Gem #105: Lady Ada Kisses Python—Part 1

    This series of two Gems explains how to use the GNAT Components Collection to interface your Ada code with Python. The first Gem describes the benefits this could bring to your application as well as the difficulties there would be in interfacing directly to the Python library. The second Gem will show how to get started with GNATCOLL to greatly simplify the interfacing process.

    Continue Reading »

  • Gem #104: Gprbuild and Configuration Files—Part 1

    In this first of a series of three Gems about configuration capabilities of gprbuild, we explain how to configure gprbuild to use a custom compiler, with the help of configuration files.

    Continue Reading »

    Johannes Kanig
    AdaCore
  • Gem #103: Code Archetypes for Real-Time Programming—Part 5

    In the programming of real-time systems, code that deals with concurrency and real-time often draws from explicit or implicit recurring patterns. It therefore is best factored out. In this series of Ada Gems, we illustrate a set of code pattern archetypes that are intended to ease the development of real-time systems.

    Continue Reading »

    Marco Panunzio
    University of Padua
  • Gem #102: SOAP/WSDL client part

    In this Gem we will use web services as described in a WSDL document.

    Continue Reading »

    Pascal Obry
    EDF R&D
  • Gem #101: SOAP/WSDL server part

    In this Gem we build a server providing Web services on the network.

    Continue Reading »

    Pascal Obry
    EDF R&D
  • Gem #100: Reference Counting in Ada - Part 3: Weak References

    This series of three Gems describes a possible implementation for automatic memory management via the use of reference counting. Part 1 explains how controlled types can be used to achieve automatic reference counting, and addresses some aspects of correct handling of reference counts. Part 2 analyzes a few issues related to tasking. Finally, Part 3 describes the use of weak reference counting. Continue Reading »

  • Gem #99: Reference Counting in Ada - Part 2: Task Safety

    This series of three Gems describes a possible implementation for automatic memory management via the use of reference counting. Part 1 explains how controlled types can be used to achieve automatic reference counting, and addresses some aspects of correct handling of reference counts. Part 2 analyzes a few issues related to tasking. Finally, Part 3 describes the use of weak reference counting. Continue Reading »

  • Gem #98: High Performance Multi-core Programming - Part 2

    This is the second in a short series of Gems about an Ada implementation of "Chameneos-Redux," a benchmark program that compares the performance of threaded applications on a multi-core machine. In this series we explore the design and implementation techniques used to make a high-performance version of the program in Ada.

    Continue Reading »

    Pat Rogers
    AdaCore
  • Gem #97: Reference Counting in Ada - Part 1

    This series of three Gems describes a possible implementation for automatic memory management, via the use of reference counting. Part 1 explains how controlled types can be used to achieve automatic reference counting, and addresses some aspects of correct handling of reference counts. Part 2 analyzes a few issues related to tasking. Finally, Part 3 describes the use of weak reference counting. Continue Reading »

   1  2  3     Next »