Skip to content

dds_stream now inherits from dds_stream_base - #11036

Merged
maloel merged 7 commits into
realsenseai:ddsfrom
maloel:dds
Oct 27, 2022
Merged

dds_stream now inherits from dds_stream_base#11036
maloel merged 7 commits into
realsenseai:ddsfrom
maloel:dds

Conversation

@maloel

@maloel maloel commented Oct 27, 2022

Copy link
Copy Markdown
Contributor

Plus:

  • fix throws; in locked_transfer::send_receive (found by cppcheck)
  • fix bug in dds_stream_uid initialization (found by the new tests)
  • replace pyrealdds.device.foreach_stream() with .stream()
  • add stream checking to test-device-init

Tracked on LRS-502 (I think?)

@maloel
maloel requested a review from OhadMeir October 27, 2022 09:11
union dds_stream_uid
{
uint32_t whole;
uint32_t whole = 0;

@OhadMeir OhadMeir Oct 27, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant
If a non-static data member has a default member initializer and also appears in a member initializer list, then the member initializer is used and the default member initializer is ignored
cppreference

@maloel maloel Oct 27, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe
And the default ctor?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. It was hidden in a collapsed part of the code.

But seeing the two added initializations made me wonder which initialization prevails :-)

}

for( size_t i = 0; i < video_stream_profiles->num_of_profiles; ++i )
if( _streams.size() >= _expected_num_of_streams )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add video_stream_profiles->num_of_profiles.
And Error only if greater than, when equals need to advance state machine

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're about to add a stream.
If we already have what we expected (or greater) then we throw an error.
What do the number of profiles have to do with it?

, index( static_cast< int8_t >( index_ ))
{}
{
whole = 0; // it covers an extra byte, which needs to be 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to change in default constructor as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the default uses the = 0 from above.

@maloel
maloel merged commit 43bebc7 into realsenseai:dds Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants