+/** A virtual device, created by the user */
+class SR_API UserDevice :
+ public UserOwned<UserDevice, struct sr_dev_inst>,
+ public Device
+{
+public:
+ /** Add a new channel to this device. */
+ shared_ptr<Channel> add_channel(unsigned int index, const ChannelType *type, string name);
+protected:
+ UserDevice(string vendor, string model, string version);
+ ~UserDevice();
+ shared_ptr<Device> get_shared_from_this();
+ /** Deleter needed to allow shared_ptr use with protected destructor. */
+ class Deleter
+ {
+ public:
+ void operator()(UserDevice *device) { delete device; }
+ };
+ friend class Context;
+ friend class Deleter;
+};
+