summaryrefslogtreecommitdiff
path: root/libgpsmm.h
diff options
context:
space:
mode:
authorSimon Dawson <spdawson@gmail.com>2013-12-08 11:20:05 +0000
committerEric S. Raymond <esr@thyrsus.com>2014-01-03 04:59:07 -0500
commit07646dda8bda112ef5ffb8425679f7bdb7f23d47 (patch)
tree6dd3d001e9505ef51860c3e0d728bfab992c0eed /libgpsmm.h
parentc31095e1562494a74d56b46fcc01541d1444cd5c (diff)
downloadgpsd-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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgpsmm.h b/libgpsmm.h
index 2b87b898..ab656b66 100644
--- a/libgpsmm.h
+++ b/libgpsmm.h
@@ -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