}
Context::Context() :
- UserOwned(_structure),
+ _structure(nullptr),
_session(nullptr)
{
check(sr_init(&_structure));
}
Driver::Driver(struct sr_dev_driver *structure) :
- ParentOwned(structure),
Configurable(structure, nullptr, nullptr),
+ _structure(structure),
_initialized(false)
{
}
HardwareDevice::HardwareDevice(shared_ptr<Driver> driver,
struct sr_dev_inst *structure) :
- UserOwned(structure),
Device(structure),
_driver(move(driver))
{
}
UserDevice::UserDevice(string vendor, string model, string version) :
- UserOwned(sr_dev_inst_user_new(
- vendor.c_str(), model.c_str(), version.c_str())),
- Device(UserOwned::_structure)
+ Device(sr_dev_inst_user_new(
+ vendor.c_str(), model.c_str(), version.c_str()))
{
}
}
Channel::Channel(struct sr_channel *structure) :
- ParentOwned(structure),
+ _structure(structure),
_type(ChannelType::get(_structure->type))
{
}
ChannelGroup::ChannelGroup(Device *device,
struct sr_channel_group *structure) :
- ParentOwned(structure),
Configurable(sr_dev_inst_driver_get(device->_structure), device->_structure, structure)
{
- for (GSList *entry = structure->channels; entry; entry = entry->next) {
+ for (GSList *entry = config_channel_group->channels; entry; entry = entry->next) {
auto *const ch = static_cast<struct sr_channel *>(entry->data);
_channels.push_back(device->_channels[ch]);
}
string ChannelGroup::name() const
{
- return valid_string(_structure->name);
+ return valid_string(config_channel_group->name);
}
vector<shared_ptr<Channel>> ChannelGroup::channels()
}
Trigger::Trigger(shared_ptr<Context> context, string name) :
- UserOwned(sr_trigger_new(name.c_str())),
+ _structure(sr_trigger_new(name.c_str())),
_context(move(context))
{
for (auto stage = _structure->stages; stage; stage = stage->next)
return stage->share_owned_by(shared_from_this());
}
-TriggerStage::TriggerStage(struct sr_trigger_stage *structure) :
- ParentOwned(structure)
+TriggerStage::TriggerStage(struct sr_trigger_stage *structure) :
+ _structure(structure)
{
}
TriggerMatch::TriggerMatch(struct sr_trigger_match *structure,
shared_ptr<Channel> channel) :
- ParentOwned(structure),
+ _structure(structure),
_channel(move(channel))
{
}
}
SessionDevice::SessionDevice(struct sr_dev_inst *structure) :
- ParentOwned(structure),
Device(structure)
{
}
}
Session::Session(shared_ptr<Context> context) :
- UserOwned(_structure),
+ _structure(nullptr),
_context(move(context))
{
check(sr_session_new(_context->_structure, &_structure));
}
Session::Session(shared_ptr<Context> context, string filename) :
- UserOwned(_structure),
+ _structure(nullptr),
_context(move(context)),
_filename(move(filename))
{
Packet::Packet(shared_ptr<Device> device,
const struct sr_datafeed_packet *structure) :
- UserOwned(structure),
+ _structure(structure),
_device(move(device))
{
switch (structure->type)
}
Header::Header(const struct sr_datafeed_header *structure) :
- ParentOwned(structure),
- PacketPayload()
+ PacketPayload(),
+ _structure(structure)
{
}
}
Meta::Meta(const struct sr_datafeed_meta *structure) :
- ParentOwned(structure),
- PacketPayload()
+ PacketPayload(),
+ _structure(structure)
{
}
}
Logic::Logic(const struct sr_datafeed_logic *structure) :
- ParentOwned(structure),
- PacketPayload()
+ PacketPayload(),
+ _structure(structure)
{
}
}
Analog::Analog(const struct sr_datafeed_analog *structure) :
- ParentOwned(structure),
- PacketPayload()
+ PacketPayload(),
+ _structure(structure)
{
}
}
InputFormat::InputFormat(const struct sr_input_module *structure) :
- ParentOwned(structure)
+ _structure(structure)
{
}
}
Input::Input(shared_ptr<Context> context, const struct sr_input *structure) :
- UserOwned(structure),
+ _structure(structure),
_context(move(context)),
_device(nullptr)
{
InputDevice::InputDevice(shared_ptr<Input> input,
struct sr_dev_inst *structure) :
- ParentOwned(structure),
Device(structure),
_input(move(input))
{
Option::Option(const struct sr_option *structure,
shared_ptr<const struct sr_option *> structure_array) :
- UserOwned(structure),
+ _structure(structure),
_structure_array(move(structure_array))
{
}
}
OutputFormat::OutputFormat(const struct sr_output_module *structure) :
- ParentOwned(structure)
+ _structure(structure)
{
}
Output::Output(shared_ptr<OutputFormat> format,
shared_ptr<Device> device, const map<string, Glib::VariantBase> &options) :
- UserOwned(sr_output_new(format->_structure,
+ _structure(sr_output_new(format->_structure,
map_to_hash_variant(options), device->_structure, nullptr)),
_format(move(format)),
_device(move(device)),
Output::Output(string filename, shared_ptr<OutputFormat> format,
shared_ptr<Device> device, const map<string, Glib::VariantBase> &options) :
- UserOwned(sr_output_new(format->_structure,
+ _structure(sr_output_new(format->_structure,
map_to_hash_variant(options), device->_structure, filename.c_str())),
_format(move(format)),
_device(move(device)),