Skip to content

Commit

Permalink
comment on usage patterns of getContent()
Browse files Browse the repository at this point in the history
  • Loading branch information
cwiede committed Nov 15, 2023
1 parent debc24c commit d0da916
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nexxT/interface/DataSamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def getContent(self):
Get the contents of this sample as a QByteArray. Note that this is an efficient operation due to the copy on
write semantics of QByteArray. It also asserts that the original contents cannot be modified.
In C++, make sure to keep an instance of the QByteArray until done with processing. Moreover, consider to use
`QByteArray::constData()` for a pointer-to-memory access rather than `QByteArray::data()`, since the latter
will eventually make an unnecessary deep copy of the encapsulated data.
:return: QByteArray instance copy
"""
return QByteArray(self._content)
Expand Down

0 comments on commit d0da916

Please sign in to comment.