diff options
author | Simon Dawson <spdawson@gmail.com> | 2013-12-08 11:20:05 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-01-03 04:59:07 -0500 |
commit | 07646dda8bda112ef5ffb8425679f7bdb7f23d47 (patch) | |
tree | 6dd3d001e9505ef51860c3e0d728bfab992c0eed /libgpsmm.h | |
parent | c31095e1562494a74d56b46fcc01541d1444cd5c (diff) | |
download | gpsd-07646dda8bda112ef5ffb8425679f7bdb7f23d47.tar.gz |
libgpsmm: add is_open method
The gpsmm constructor effectively hides the useful status flag returned
by the underlying gps_open call.
It is extremely useful for client code to be able to check that the
gpsmm constructor was successful. To this end, add a gpsmm::is_open method
which simply checks that the gpsmm::to_user member is non-NULL. A NULL
gpsmm::to_user member can only mean that the constructor was not successful.
Signed-off-by: Simon Dawson <spdawson@gmail.com>
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'libgpsmm.h')
-rw-r--r-- | libgpsmm.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -45,6 +45,7 @@ class LIBQGPSMMSHARED_EXPORT gpsmm { bool waiting(int); // blocking check for data waiting void clear_fix(void); void enable_debug(int, FILE*); + bool is_open(void); // check for constructor success private: struct gps_data_t *to_user; //we return the user a copy of the internal structure. This way she can modify it without //integrity loss for the entire class |