Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding implementation for instance_state and view_state [12758] #2298

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
9d2f2d6
Refs 12400. Added DataReaderCacheChange.
MiguelCompany Aug 31, 2021
52b6c9f
Refs 12400. Added DataReaderInstance.
MiguelCompany Sep 1, 2021
7280d7a
Refs 12400. DataReaderHistory using new types.
MiguelCompany Sep 3, 2021
b2b1fae
Refs 12400. Removing unnecessary method from SubscriberHistory.
MiguelCompany Sep 7, 2021
4ee4f02
Refs 12400. ReadTakeCommand receives full instance information.
MiguelCompany Sep 7, 2021
e2ef28c
Refs 12400. ReadTakeCommand checks for instance states.
MiguelCompany Sep 7, 2021
da93a9d
Refs 12400. ReadTakeCommand fills sample info from instance data.
MiguelCompany Sep 7, 2021
0c1f59f
Refs 12400. Added insert method to ResourceLimitedVector.
MiguelCompany Sep 7, 2021
817dfd4
Refs 12400. DataReaderInstance uses ResourceLimitedVector.
MiguelCompany Sep 7, 2021
860b932
Refs 12400. get_first_untaken_info takes sample info from instance data.
MiguelCompany Sep 8, 2021
f868b4d
Refs 12400. Discard received change when older than oldest.
MiguelCompany Sep 8, 2021
bb5e29b
Refs 12400. Fixing KEEP_ALL with keys.
MiguelCompany Sep 8, 2021
0b2b047
Refs 12400. Refactor to always use instances.
MiguelCompany Sep 8, 2021
9c69a9a
Refs 12400. Basic structure for update instance state.
MiguelCompany Oct 26, 2021
b555617
Refs 12400. Adding alive_writers and current_owner to DataReaderInsta…
MiguelCompany Oct 26, 2021
0ae7cd8
Refs 12400. Implementing writer_alive.
MiguelCompany Oct 26, 2021
1284cbc
Refs 12400. Implementing writer_dispose.
MiguelCompany Oct 26, 2021
d863991
Refs 12400. Implementing writer_unregister.
MiguelCompany Oct 26, 2021
7f6f641
Refs 12400. Setting NOT_NEW on returned instances.
MiguelCompany Oct 26, 2021
664aca1
Refs 12400. Correct return code when returning samples with no data.
MiguelCompany Oct 27, 2021
570b43f
Refs 12400. Set view_state to NEW when changing instance_state to ALIVE.
MiguelCompany Oct 27, 2021
3020516
Refs 12400. Moving generation counts into CacheChange_t.
MiguelCompany Oct 27, 2021
48f7a44
Refs 12400. Assigning generation counts after processing instance state.
MiguelCompany Oct 27, 2021
3ee50bd
Refs 12400. Update instance_state when writer becomes not alive.
MiguelCompany Oct 27, 2021
50b8868
Refs 12400. Clear alive_writers when changing generation.
MiguelCompany Oct 27, 2021
2f61a2e
Refs 12400. Add writer_unmatched to ReaderHistory.
MiguelCompany Oct 27, 2021
5e57866
Refs 12400. NOT_ALIVE_UNREGISTERED should not return valid data.
MiguelCompany Oct 28, 2021
d3d0e3d
Refs 12400. Set autodispose_unregistered_instances to false on test.
MiguelCompany Oct 28, 2021
5b4c855
Refs 12400. Remove instance when it becomes empty and is not alive.
MiguelCompany Oct 28, 2021
2a9f55e
Refs 12400. Refactor into writer_not_alive.
MiguelCompany Oct 29, 2021
38ca299
Refs 12400. Keeping samples from unmatched writers.
MiguelCompany Oct 29, 2021
961408c
Refs 12400. Avoid keeping non-notified samples.
MiguelCompany Oct 29, 2021
14fcb19
Refs 12400. Linters.
MiguelCompany Oct 29, 2021
db2013c
Refs 12758. Fixing compilation warnings on windows.
Nov 23, 2021
af7667f
Refs 12758. Fixing assertion on WriterProxy logic. If we only notify …
Nov 29, 2021
9e6e9bb
Refs 12758 Fixing DataReaderHistory test that checks DataWriter dispo…
Nov 30, 2021
30adad9
Refs 12758. Use move semantics.
MiguelCompany Dec 7, 2021
2e9595e
Refs 12758. Use ResourceLimitedVector for writers.
MiguelCompany Dec 7, 2021
bd0d144
Refs 12758. Apply pre-allocation policies.
MiguelCompany Dec 7, 2021
f5f8fb5
Refs 12758. Uncrustify.
MiguelCompany Dec 7, 2021
737c241
Refs 12758. PubSubReader. Account for writer_guid on last_seq checks.
MiguelCompany Dec 7, 2021
c4d11dd
Refs 12758. Added can_change_be_added_nts.
MiguelCompany Dec 13, 2021
fb10bcb
Refs 12758. Removed unused method.
MiguelCompany Dec 13, 2021
0bd9fcb
Refs 12758. Always use completed changes for key computation.
MiguelCompany Dec 13, 2021
6ecf193
Refs 12758. Fixed ResourceLimitedVector::insert.
MiguelCompany Dec 13, 2021
134f9b1
Refs 12758. Uncrustify.
MiguelCompany Dec 13, 2021
1b42b23
Refs 12758. Avoid dynamic allocation inside remove_changes_with_pred.
MiguelCompany Dec 13, 2021
574622b
Refs 12758. Optimization on DataReaderHistory::remove_change_nts.
MiguelCompany Dec 13, 2021
a7f2ae1
Refs 12758. Method writer_unmatched documented and improved.
MiguelCompany Dec 13, 2021
6149ee3
Refs 12758. Do not complete changes for non-keyed topics.
MiguelCompany Dec 14, 2021
ec5336c
Refs 12758. Do not remove incomplete changes for keyed topics.
MiguelCompany Dec 15, 2021
64e52e5
Refs 12758. Different removal policy on ReaderHistory and DataReaderH…
MiguelCompany Dec 16, 2021
f956e80
Refs 12758. Fix unused parameter warning.
MiguelCompany Dec 16, 2021
134afc6
Refs 12758. Removed unused header.
MiguelCompany Dec 20, 2021
ed04235
Refs 12758. Doxydoc improvements.
MiguelCompany Dec 20, 2021
11fee0a
Refs 12758. Linters.
MiguelCompany Dec 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refs 12400. Removing unnecessary method from SubscriberHistory.
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Dec 17, 2021
commit b2b1fae87392b70774799a0136a1f2a633f3da8f
21 changes: 0 additions & 21 deletions include/fastrtps/subscriber/SubscriberHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class SubscriberHistory : public rtps::ReaderHistory
{
public:

using instance_info = std::pair<rtps::InstanceHandle_t, std::vector<rtps::CacheChange_t*>*>;

/**
* Constructor. Requires information about the subscriber.
* @param topic_att TopicAttributes.
Expand Down Expand Up @@ -179,25 +177,6 @@ class SubscriberHistory : public rtps::ReaderHistory
rtps::InstanceHandle_t& handle,
std::chrono::steady_clock::time_point& next_deadline_us);

/**
* @brief Get the list of changes corresponding to an instance handle.
* @param handle The handle to the instance.
* @param exact Indicates if the handle should match exactly (true) or if the first instance greater than the
* input handle should be returned.
* @return A pair where:
* - @c first is a boolean indicating if an instance was found
* - @c second is a pair where:
* - @c first is the handle of the returned instance
* - @c second is a pointer to a std::vector<rtps::CacheChange_t*> with the list of changes for the
* returned instance
*
* @remarks When used on a NO_KEY topic, an instance will only be returned when called with
* `handle = HANDLE_NIL` and `exact = false`.
*/
std::pair<bool, instance_info> lookup_instance(
const rtps::InstanceHandle_t& handle,
bool exact);

private:

using t_m_Inst_Caches = std::map<rtps::InstanceHandle_t, KeyedChanges>;
Expand Down
52 changes: 0 additions & 52 deletions src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,58 +693,6 @@ bool SubscriberHistory::get_next_deadline(
return false;
}

std::pair<bool, SubscriberHistory::instance_info> SubscriberHistory::lookup_instance(
const InstanceHandle_t& handle,
bool exact)
{
if (topic_att_.getTopicKind() == NO_KEY)
{
if (handle.isDefined())
{
// NO_KEY topics can only return the ficticious instance.
// Execution can only get here for two reasons:
// - Looking for a specific instance (exact = true)
// - Looking for the next instance to the ficticious one (exact = false)
// In both cases, no instance should be returned
return { false, {InstanceHandle_t(), nullptr} };
}
else
{
if (exact)
{
// Looking for HANDLE_NIL, nothing to return
return { false, {InstanceHandle_t(), nullptr} };
}

// Looking for the first instance, return the ficticious one containing all changes
InstanceHandle_t tmp;
tmp.value[0] = 1;
return { true, {tmp, &m_changes} };
}
}

t_m_Inst_Caches::iterator it;

if (exact)
{
it = keyed_changes_.find(handle);
}
else
{
auto comp = [](const InstanceHandle_t& h, const std::pair<InstanceHandle_t, KeyedChanges>& it)
{
return h < it.first;
};
it = std::upper_bound(keyed_changes_.begin(), keyed_changes_.end(), handle, comp);
}

if (it != keyed_changes_.end())
{
return { true, {it->first, &(it->second.cache_changes)} };
}
return { false, {InstanceHandle_t(), nullptr} };
}

ReaderHistory::iterator SubscriberHistory::remove_change_nts(
ReaderHistory::const_iterator removal,
bool release)
Expand Down