Abstract

The program gama-local is a part of GNU Gama project and allows adjustment of local geodetic networks. Before realization of this project the program gama-local supported only XML as an input. I designed and implemented support for the SQLite database and thanks to this extension gama-local can read input data from the SQLite database. This article is focused on the specifics of the use of callback functions in C++ using the native SQLite C/C++ Application Programming Interface. The article provides solution to safe calling of callback functions written in C++. Callback functions are called from C library and C library itself is used by C++ program. Provided solution combines several programing techniques which are described in detail, so this article can serve as a cookbook even for beginner programmers. This project was accomplished within my bachelor thesis.

Highlights

  • GNU Gama is a library and set of programs for adjustment of geodetic networks

  • Information provided in this paper was used for implementing SQLite support in gama-local

  • This paper presents something like reusable design pattern because this information can be used generally when interfacing C++ code with C code or library

Read more

Summary

Introduction

GNU Gama is a library and set of programs for adjustment of geodetic networks. Project is licensed under the GNU GPL and is written in C++ programming language. Project GNU Gama uses interface using callback functions It was chosen for implementation because this interface is considered to be the most stable one in terms of changes between versions of SQLite C/C++ API. Catching all possible exceptions is not enough, it is necessary to report error to callback function caller (it is library function sqlite3_exec in our case). Consider the case we have to catch all exceptions, keep information about exception type and later use this exception This is the case of callback functions used with SqliteReader class. Class is derived from std::exception in order to add function what to interface and to allow handling standard exceptions and specific GNU Gama exceptions together when necessary. In SqliteReader implementation a wrapper function for sqlite3_exec function was introduced This wrapper ensures rethrowing of previously stored exception.

Conclusion
13. GCC Bugzilla
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.