Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 2.57 KB

library_architecture.rst

File metadata and controls

59 lines (41 loc) · 2.57 KB

Library Architecture

EasyNMEA is divided into three levels (from outer to inner):

  1. :ref:`dev_docs_libs_arch_api` : This level contains all public API, i.e. the classes in the include directory.
  2. :ref:`dev_docs_libs_arch_impl`: This level contains all the internal classes which provide functionality to the library.
  3. :ref:`dev_docs_libs_arch_serial`: This level contains the classes for interacting with the serial port (through Asio).
.. uml:: ../../uml/library_levels.puml

API Level

The API level comprises all the EasyNMEA public classes and structures, and acts as entry point for the library's functionalities. It consists of a main class |EasyNmea-api|, which provides application with access to the functionalities, and all the supporting classes and structures for return types and input and output parameters. Those companion classes and structures are |ReturnCode-api|, |GPGGAData-api|, and |NMEA0183DataKindMask-api|. For the actual functionality implementation, |EasyNmea-api| relies on the internal class |EasyNmeaImpl-api|.

.. uml:: ../../uml/EasyNmea.puml

Implementation Level

The implementation level comprises two main components:

  1. The |EasyNmeaImpl-api| class, which provides with implementation for the |EasyNmea-api| public API, i.e opening and closing the serial port, waiting until data of one or more NMEA 0183 types has been received, checking whether the serial port connection is opened, and taking the next unread sample of a given NMEA 0183 type. The |EasyNmeaImpl-api| holds a |FixedSizeQueue-api| of ten elements for each supported NMEA 0183 type. This way, keeping outdated samples, as well as dynamic allocation of data samples, is avoided. The managing of the serial port is enabled through the |SerialInterface-api| class.
  2. The |EasyNmeaCoder-api| class, which provides APIs for decode NMEA 0183 sentences (and to encode them in the future).
.. uml:: ../../uml/impl_level.puml

Serial Interface Level

The serial interface level is comprised of the |SerialInterface-api| class, which provides member functions to open and close a serial port, as well as for reading data from it. |SerialInterface-api| is a template class with a template parameter :class:`SerialPort` that defines the serial port implementation, which defaults to :class: :class:`asio::serial_port`.

.. uml:: ../../uml/SerialInterface.puml