{
auto name = entry.first;
auto driver = entry.second;
- result[name] = driver->get_shared_pointer(shared_from_this());
+ result[name] = driver->share_owned_by(shared_from_this());
}
return result;
}
{
auto name = entry.first;
auto input_format = entry.second;
- result[name] = input_format->get_shared_pointer(shared_from_this());
+ result[name] = input_format->share_owned_by(shared_from_this());
}
return result;
}
{
auto name = entry.first;
auto output_format = entry.second;
- result[name] = output_format->get_shared_pointer(shared_from_this());
+ result[name] = output_format->share_owned_by(shared_from_this());
}
return result;
}
vector<shared_ptr<Channel>> result;
for (auto channel = sr_dev_inst_channels_get(_structure); channel; channel = channel->next) {
auto *const ch = static_cast<struct sr_channel *>(channel->data);
- result.push_back(_channels[ch]->get_shared_pointer(get_shared_from_this()));
+ result.push_back(_channels[ch]->share_owned_by(get_shared_from_this()));
}
return result;
}
shared_ptr<Channel> Device::get_channel(struct sr_channel *ptr)
{
- return _channels[ptr]->get_shared_pointer(get_shared_from_this());
+ return _channels[ptr]->share_owned_by(get_shared_from_this());
}
map<string, shared_ptr<ChannelGroup>>
{
auto name = entry.first;
auto channel_group = entry.second;
- result[name] = channel_group->get_shared_pointer(get_shared_from_this());
+ result[name] = channel_group->share_owned_by(get_shared_from_this());
}
return result;
}
{
vector<shared_ptr<Channel>> result;
for (auto channel : _channels)
- result.push_back(channel->get_shared_pointer(_parent));
+ result.push_back(channel->share_owned_by(_parent));
return result;
}
{
vector<shared_ptr<TriggerStage>> result;
for (auto stage : _stages)
- result.push_back(stage->get_shared_pointer(shared_from_this()));
+ result.push_back(stage->share_owned_by(shared_from_this()));
return result;
}
{
auto stage = new TriggerStage(sr_trigger_stage_add(_structure));
_stages.push_back(stage);
- return stage->get_shared_pointer(shared_from_this());
+ return stage->share_owned_by(shared_from_this());
}
TriggerStage::TriggerStage(struct sr_trigger_stage *structure) :
{
vector<shared_ptr<TriggerMatch>> result;
for (auto match : _matches)
- result.push_back(match->get_shared_pointer(shared_from_this()));
+ result.push_back(match->share_owned_by(shared_from_this()));
return result;
}
{
if (_owned_devices.count(sdi))
return static_pointer_cast<Device>(
- _owned_devices[sdi]->get_shared_pointer(shared_from_this()));
+ _owned_devices[sdi]->share_owned_by(shared_from_this()));
else if (_other_devices.count(sdi))
return _other_devices[sdi];
else
shared_ptr<PacketPayload> Packet::payload()
{
if (_payload)
- return _payload->get_shared_pointer(shared_from_this());
+ return _payload->share_owned_by(shared_from_this());
else
throw Error(SR_ERR_NA);
}
{
}
-shared_ptr<PacketPayload> Header::get_shared_pointer(shared_ptr<Packet> _parent)
+shared_ptr<PacketPayload> Header::share_owned_by(shared_ptr<Packet> _parent)
{
return static_pointer_cast<PacketPayload>(
- ParentOwned::get_shared_pointer(_parent));
+ ParentOwned::share_owned_by(_parent));
}
int Header::feed_version() const
{
}
-shared_ptr<PacketPayload> Meta::get_shared_pointer(shared_ptr<Packet> _parent)
+shared_ptr<PacketPayload> Meta::share_owned_by(shared_ptr<Packet> _parent)
{
return static_pointer_cast<PacketPayload>(
- ParentOwned::get_shared_pointer(_parent));
+ ParentOwned::share_owned_by(_parent));
}
map<const ConfigKey *, Glib::VariantBase> Meta::config() const
{
}
-shared_ptr<PacketPayload> Logic::get_shared_pointer(shared_ptr<Packet> _parent)
+shared_ptr<PacketPayload> Logic::share_owned_by(shared_ptr<Packet> _parent)
{
return static_pointer_cast<PacketPayload>(
- ParentOwned::get_shared_pointer(_parent));
+ ParentOwned::share_owned_by(_parent));
}
void *Logic::data_pointer()
{
}
-shared_ptr<PacketPayload> Analog::get_shared_pointer(shared_ptr<Packet> _parent)
+shared_ptr<PacketPayload> Analog::share_owned_by(shared_ptr<Packet> _parent)
{
return static_pointer_cast<PacketPayload>(
- ParentOwned::get_shared_pointer(_parent));
+ ParentOwned::share_owned_by(_parent));
}
void *Analog::data_pointer()
_device = new InputDevice(shared_from_this(), sdi);
}
- return _device->get_shared_pointer(shared_from_this());
+ return _device->share_owned_by(shared_from_this());
}
void Input::send(void *data, size_t length)
return shared;
}
- shared_ptr<Class> get_shared_pointer(shared_ptr<Parent> parent)
+ shared_ptr<Class> share_owned_by(shared_ptr<Parent> parent)
{
if (!parent)
throw Error(SR_ERR_BUG);
PacketPayload();
virtual ~PacketPayload() = 0;
private:
- virtual shared_ptr<PacketPayload> get_shared_pointer(shared_ptr<Packet> parent) = 0;
+ virtual shared_ptr<PacketPayload> share_owned_by(shared_ptr<Packet> parent) = 0;
/** Deleter needed to allow shared_ptr use with protected destructor. */
class Deleter
private:
explicit Header(const struct sr_datafeed_header *structure);
~Header();
- shared_ptr<PacketPayload> get_shared_pointer(shared_ptr<Packet> parent);
+ shared_ptr<PacketPayload> share_owned_by(shared_ptr<Packet> parent);
friend class Packet;
};
private:
explicit Meta(const struct sr_datafeed_meta *structure);
~Meta();
- shared_ptr<PacketPayload> get_shared_pointer(shared_ptr<Packet> parent);
+ shared_ptr<PacketPayload> share_owned_by(shared_ptr<Packet> parent);
map<const ConfigKey *, Glib::VariantBase> _config;
friend class Packet;
};
private:
explicit Logic(const struct sr_datafeed_logic *structure);
~Logic();
- shared_ptr<PacketPayload> get_shared_pointer(shared_ptr<Packet> parent);
+ shared_ptr<PacketPayload> share_owned_by(shared_ptr<Packet> parent);
friend class Packet;
};
private:
explicit Analog(const struct sr_datafeed_analog *structure);
~Analog();
- shared_ptr<PacketPayload> get_shared_pointer(shared_ptr<Packet> parent);
+ shared_ptr<PacketPayload> share_owned_by(shared_ptr<Packet> parent);
friend class Packet;
};