Repository navigation
Add ReferenceCounter::GetRefCount() method - #1512
Conversation
This adds a new method to the ReferenceCounter class which will allow the integer count value to be retrieved. Use of this new method in LoadImage() provides simpler, more efficient code. Resolves MythTV#1511
|
@SteveErl Two small things on the new method: int GetRefCount(void) { return static_cast<int>(m_referenceCount); };The coding standards ask that a Get method be const, and this one can be: |
|
@BobEntwhistle I tried adding in |
An unnecessary ';' was left at the end of the new methode. This has been stripped. Resolves: MythTV#1511
|
@BobEntwhistle as I understand it, the static_cast does trigger the internal QAtomicInt::operator int() const which means that the code as proposed does already do exactly what you want, i.e. be const. However, it is not explicit. |
|
@kmdewaal Your suggestion sounds good to me. I'll make it more explicitly const. |
This update adds a 'const' keyword to make it more clear that no changes to m_referenceCount will be made by calling this new routine. Resolves MythTV#1511
This adds a new GetRefCount() method to the ReferenceCounter class which will allow the integer count value to be retrieved. Use of this new method in LoadImage() provides simpler, more efficient code.
Resolves #1511
Checklist