projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved DevInst into the pv::device namespace
[pulseview.git]
/
pv
/
devicemanager.h
diff --git
a/pv/devicemanager.h
b/pv/devicemanager.h
index 070c3cc7d94ef202e52968333d3ec608589768bc..3ed74e078f2baa3234b9807eb6d62e4e2af6f7ac 100644
(file)
--- a/
pv/devicemanager.h
+++ b/
pv/devicemanager.h
@@
-24,13
+24,22
@@
#include <glib.h>
#include <list>
#include <glib.h>
#include <list>
+#include <map>
+#include <string>
+
+#include <boost/shared_ptr.hpp>
struct sr_context;
struct sr_dev_driver;
struct sr_context;
struct sr_dev_driver;
-struct sr_dev_inst;
namespace pv {
namespace pv {
+class SigSession;
+
+namespace device {
+class DevInst;
+}
+
class DeviceManager
{
public:
class DeviceManager
{
public:
@@
-38,25
+47,35
@@
public:
~DeviceManager();
~DeviceManager();
- const std::list<sr_dev_inst*>& devices() const;
+ const std::list< boost::shared_ptr<pv::device::DevInst> >&
+ devices() const;
- std::list<sr_dev_inst*> driver_scan(
+ void use_device(boost::shared_ptr<pv::device::DevInst> dev_inst,
+ SigSession *owner);
+
+ void release_device(boost::shared_ptr<pv::device::DevInst> dev_inst);
+
+ std::list< boost::shared_ptr<pv::device::DevInst> > driver_scan(
struct sr_dev_driver *const driver,
GSList *const drvopts = NULL);
private:
void init_drivers();
struct sr_dev_driver *const driver,
GSList *const drvopts = NULL);
private:
void init_drivers();
-
static
void release_devices();
+ void release_devices();
void scan_all_drivers();
void scan_all_drivers();
- static bool compare_devices(const sr_dev_inst *const a,
- const sr_dev_inst *const b);
+ void release_driver(struct sr_dev_driver *const driver);
+
+ static bool compare_devices(boost::shared_ptr<device::DevInst> a,
+ boost::shared_ptr<device::DevInst> b);
private:
struct sr_context *const _sr_ctx;
private:
struct sr_context *const _sr_ctx;
- std::list<sr_dev_inst*> _devices;
+ std::list< boost::shared_ptr<pv::device::DevInst> > _devices;
+ std::map< boost::shared_ptr<pv::device::DevInst>, pv::SigSession*>
+ _used_devices;
};
} // namespace pv
};
} // namespace pv