Implementation of SQLite database support in program gama-local
Keywords:GNU Gama, adjustment of geodetic networks, programming, C, C , databases, SQLite, callback functions
AbstractThe 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.
ČEPEK, Aleš. GNU Gama manual [online]. 2011-08-16. http://www.gnu.org/software/gama/manual/gama.pdf
ČEPEK, Aleš; PYTEL, Jan. A Note on Numerical Solutions of Least Squares Adjustment in GNU Project Gama In: Interfacing Geostatistics and GIS. Berlin: SpringerVerlag, 2009, p. 179. ISBN 978-3-540-33235-0.
SQLite [program]. Version 3. 2004-2011. http://www.sqlite.org/
PETRÁŠ, Václav. Podpora databáze SQLite pro program gama-local. Praha 2011. 75 s. Bakalářská práce. ČVUT v Praze, Fakulta stavební http://geo.fsv.cvut.cz/proj/bp/2011/vaclav-petras-bp-2011.pdf
NOVÁK, Jiří. Object – oriented GUI for GNU Gama. Prague, 2010. 63 p. Bachelor thesis. CTU in Prague, Faculty of Civil Engineering. http://geo.fsv.cvut.cz/proj/bp/2010/jiri-novak-bp-2010.pdf
GNU FTP server mirrors. GNU Gama release 1.11 http://ftp.sh.cvut.cz/MIRRORS/gnu/pub/gnu/gama/gama-1.11.tar.gz
GNU Gama Git source code repository http://git.savannah.gnu.org/cgit/gama.git/
The C language interface to SQLite Version 2 [online]. Modified 2011-09-21. http://www.sqlite.org/c_interface.html.
C/C++ Interface For SQLite Version 3 [online]. Modified 2011-09-21. http://www.sqlite.org/capi3ref.html.
STROUSTRUP, Bjarne. The C++ Programming Language. Special Edition. AT&T Labs, Florham Park, New Jersey. United States of America: Addison-Wesley, 2000. 1020 p. ISBN 0-201-70073-5.
ISO/IEC 14882. INTERNATIONAL STANDARD: Programming languages — C++. 11 West 42nd Street, New York, New York 10036: American National Standards Institute, First edition, 1998-09-01. 748 p.
Free Software Foundation, Inc. GCC, the GNU Compiler Collection [program]. Version 4.4.3, Copyright 2009 Free Software Foundation, Inc. http://www.gnu.org/software/gcc/
GCC Bugzilla: Bug 2316 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316
SUTTER, Herb; ALEXANDRESCU, Andrei. C++ Coding Standards: 101 Rules, Guidelines, and Best Practices. 1st edition. Addison-Wesley Professional, 2004. 240 p. ISBN 0321113586.
GNU Gama Git source code repository: gama-local directory. Files: sqlitereader.h and sqlitereader.cpp. http://git.savannah.gnu.org/cgit/gama.git/tree/lib/gnu_gama/local/
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).