[niepce] [niepce] GpDevice implementation.



commit c5f4d5de5508eca4528775481ee018d5ca1f98e8
Author: Hubert Figuiere <hub figuiere net>
Date:   Fri May 22 14:59:26 2009 -0400

    [niepce] GpDevice implementation.
---
 ChangeLog                |    3 +++
 src/fwk/utils/gphoto.cpp |   10 ++++++++++
 src/fwk/utils/gphoto.hpp |   18 ++++++++++++++----
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 29e0ed3..9245258 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2009-05-22  Hubert Figuiere  <hub figuiere net>
 
 	* src/fwk/utils/gphoto.{hpp,cpp}:
+	GpDevice implementation.
+
+	* src/fwk/utils/gphoto.{hpp,cpp}:
 	* src/fwk/utils/Makefile.am:
 	* configure.ac
 	* README
diff --git a/src/fwk/utils/gphoto.cpp b/src/fwk/utils/gphoto.cpp
index 8164173..8d302a3 100644
--- a/src/fwk/utils/gphoto.cpp
+++ b/src/fwk/utils/gphoto.cpp
@@ -34,6 +34,14 @@ namespace fwk {
     DBG_OUT("%s failed with %d",#op,x); }
 
 
+GpDevice::GpDevice(const std::string & model, const std::string & path)
+  : m_model(model)
+  , m_path(path)
+{
+}
+
+
+
 GpDeviceList::GpDeviceList()
   : m_abilities(NULL)
   , m_ports(NULL)
@@ -106,4 +114,6 @@ void GpDeviceList::detect()
 }
 
 
+
+
 }
diff --git a/src/fwk/utils/gphoto.hpp b/src/fwk/utils/gphoto.hpp
index d199d14..79cdc86 100644
--- a/src/fwk/utils/gphoto.hpp
+++ b/src/fwk/utils/gphoto.hpp
@@ -42,8 +42,16 @@ class GpDevice
 public:
   typedef std::tr1::shared_ptr<GpDevice> Ptr;
 
-  GpDevice(const std::string & m_model, const std::string & m_path);
-
+  GpDevice(const std::string & model, const std::string & path);
+
+  const std::string & get_model() const
+    {
+      return m_model;
+    }
+  const std::string & get_path() const
+    {
+      return m_path;
+    }
 private:
   std::string m_model;
   std::string m_path;
@@ -53,15 +61,17 @@ private:
 
 class GpDeviceList
   : public fwk::Singleton<GpDeviceList>
-  , private std::list<GpDevice::Ptr>
+  , public std::list<GpDevice::Ptr>
 {
 public:
   ~GpDeviceList();
 
   void reload();
   void detect();
-private:
+protected:
+  friend class fwk::Singleton<GpDeviceList>;
   GpDeviceList();
+private:
 
   void _gp_cleanup();
   ::CameraAbilitiesList *m_abilities;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]