}
Context::Context() :
+ UserOwned(structure),
session(NULL)
{
check(sr_init(&structure));
+
struct sr_dev_driver **driver_list = sr_driver_list();
if (driver_list)
for (int i = 0; driver_list[i]; i++)
}
Trigger::Trigger(shared_ptr<Context> context, string name) :
- structure(sr_trigger_new(name.c_str())), context(context)
+ UserOwned(sr_trigger_new(name.c_str())),
+ context(context)
{
for (auto stage = structure->stages; stage; stage = stage->next)
stages.push_back(new TriggerStage((struct sr_trigger_stage *) stage->data));
}
Session::Session(shared_ptr<Context> context) :
+ UserOwned(structure),
context(context), saving(false)
{
check(sr_session_new(&structure));
}
Session::Session(shared_ptr<Context> context, string filename) :
+ UserOwned(structure),
context(context), saving(false)
{
check(sr_session_load(filename.c_str(), &structure));
Packet::Packet(shared_ptr<Device> device,
const struct sr_datafeed_packet *structure) :
- structure(structure),
+ UserOwned(structure),
device(device)
{
switch (structure->type)
}
Input::Input(shared_ptr<Context> context, const struct sr_input *structure) :
- structure(structure),
+ UserOwned(structure),
context(context),
device(nullptr)
{
Option::Option(const struct sr_option *structure,
shared_ptr<const struct sr_option *> structure_array) :
- structure(structure),
+ UserOwned(structure),
structure_array(structure_array)
{
}
Output::Output(shared_ptr<OutputFormat> format,
shared_ptr<Device> device, map<string, Glib::VariantBase> options) :
- structure(sr_output_new(format->structure,
+ UserOwned(sr_output_new(format->structure,
map_to_hash_variant(options), device->structure)),
format(format), device(device), options(options)
{