#include <memory>
#include <vector>
#include <map>
+#include <set>
namespace sigrok
{
weak_ptr<Class> _weak_this;
public:
+ /* Get parent object that owns this object. */
+ shared_ptr<Parent> parent()
+ {
+ return _parent;
+ }
+
/* Note, this implementation will create a new smart_ptr if none exists. */
shared_ptr<Class> shared_from_this()
{
friend class Driver;
};
+enum Capability {
+ GET = SR_CONF_GET,
+ SET = SR_CONF_SET,
+ LIST = SR_CONF_LIST
+};
+
/** An object that can be configured. */
class SR_API Configurable
{
* @param key ConfigKey to enumerate values for. */
Glib::VariantContainerBase config_list(const ConfigKey *key);
/** Enumerate available keys, according to a given index key. */
- vector<const ConfigKey *> config_keys(const ConfigKey *key);
+ map<const ConfigKey *, set<Capability> > config_keys(const ConfigKey *key);
/** Check for a key in the list from a given index key. */
bool config_check(const ConfigKey *key, const ConfigKey *index_key);
protected:
{
public:
/** Description identifying this device. */
- string description();
+ virtual string description();
/** Vendor name for this device. */
string vendor();
/** Model name for this device. */
string model();
/** Version string for this device. */
string version();
+ /** Serial number for this device. */
+ string serial_number();
+ /** Connection ID for this device. */
+ string connection_id();
/** List of the channels available on this device. */
vector<shared_ptr<Channel> > channels();
/** Channel groups available on this device, indexed by name. */
public ParentOwned<SessionDevice, Session, struct sr_dev_inst>,
public Device
{
+ /** Description identifying this device. */
+ string description();
protected:
SessionDevice(struct sr_dev_inst *sdi);
~SessionDevice();
/** Set trigger setting.
* @param trigger Trigger object to use. */
void set_trigger(shared_ptr<Trigger> trigger);
+ /** Get filename this session was loaded from. */
+ string filename();
protected:
Session(shared_ptr<Context> context);
Session(shared_ptr<Context> context, string filename);
~Session();
+ shared_ptr<Device> get_device(const struct sr_dev_inst *sdi);
const shared_ptr<Context> _context;
- map<const struct sr_dev_inst *, shared_ptr<Device> > _devices;
+ map<const struct sr_dev_inst *, SessionDevice *> _owned_devices;
+ map<const struct sr_dev_inst *, shared_ptr<Device> > _other_devices;
vector<DatafeedCallbackData *> _datafeed_callbacks;
map<shared_ptr<EventSource>, SourceCallbackData *> _source_callbacks;
+ string _filename;
bool _saving;
bool _save_initialized;
string _save_filename;
friend class Deleter;
friend class Context;
friend class DatafeedCallbackData;
+ friend class SessionDevice;
};
/** A packet on the session datafeed */
public ParentOwned<InputDevice, Input, struct sr_dev_inst>,
public Device
{
+public:
+ /** Description identifying this device. */
+ string description();
protected:
InputDevice(shared_ptr<Input> input, struct sr_dev_inst *sdi);
~InputDevice();