Project

General

Profile

User story #168

Updated by André Neto over 9 years ago

The definition of static objects in headers must be avoided, because the static keyword (do not confuse it with the class static keyword) it is intended to make objects private to their compilation units (i.e. cpp files).

Moreover, defining objects on headers declared as static will create multiple copies of those objects (one per each time a compilation unit include the header).

This can observed, for example, on /MARTe2/Source/Core/L0Portability/OperatingSystem/Linux/HighResolutionTimerOS.h (line 47 @ revision e49a441):
<pre>
static HighResolutionTimerCalibratorOS calibratedHighResolutionTimer;
</pre>

Note: The refactoring to apply must be agreed case per case.

h1. Source code files modified

* Source/Core/L0Portability/BasicConsole.h
* Source/Core/L0Portability/OperatingSystem/Linux/BasicConsoleOS.cpp
* Source/Core/L0Portability/OperatingSystem/Windows/BasicConsoleOS.cpp

h1. Architecture & design review

*Date of the review:* as per #150.

*Person who did the review:* N/A

*Version of architecture & design document:* N/A

*Result of review:* N/A

*List of non-conformities:* N/A

h1. Code and documentation review

*Date of the review:* 20/08/2015. 12/08/2015.

*Person who did the review:* Andre' Neto

*Result of review:* PASS FAIL

*List of non-conformities:*

* Functions HighResolutionTimerCalibratorOS::GetInitialTicks() and HighResolutionTimerCalibratorOS::GetPeriod() are not used and can be removed;

h1. Unit test review

*Date of the review:* 20/08/2015 ../../2015

*Person who did the review:* Andre' Neto



*Result of coverage tests review:* PASS



*Result of functional tests review:* PASS



*Result of review:* PASS



*List of non-conformities:*

Back