{
}
+string SessionDevice::description()
+{
+ return _parent->_filename;
+}
+
shared_ptr<Device> SessionDevice::get_shared_from_this()
{
return static_pointer_cast<Device>(shared_from_this());
Session::Session(shared_ptr<Context> context, string filename) :
UserOwned(_structure),
_context(context),
+ _filename(filename),
_saving(false)
{
check(sr_session_load(filename.c_str(), &_structure));
{
}
+string InputDevice::description()
+{
+ return "<input data>";
+}
+
shared_ptr<Device> InputDevice::get_shared_from_this()
{
return static_pointer_cast<Device>(shared_from_this());
{
public:
/** Description identifying this device. */
- string description();
+ virtual string description();
/** Vendor name for this device. */
string vendor();
/** Model name for this device. */
public ParentOwned<SessionDevice, Session, struct sr_dev_inst>,
public Device
{
+ /** Description identifying this device. */
+ string description();
protected:
SessionDevice(struct sr_dev_inst *sdi);
~SessionDevice();
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();