View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026397 | Open CASCADE | OCCT:Foundation Classes | public | 2015-07-03 10:37 | 2023-08-01 15:08 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | ||
Status | new | Resolution | open | ||
Target Version | Unscheduled | ||||
Summary | 0026397: Change method DownCast() of Handle to return a pointer rather than a Handle | ||||
Description | Method DownCast() of opencascade::handle<> can be changed to return a pointer instead of constructing a new handle. The benefits would be: - No overhead for incrementing / decrementing reference counter if result of DownCast() is used to access the object directly - Possible more efficient code when new Handle() is initialized by result of DownCast() - Safer code -- compiler may complain if result of DownCast() is assigned to reference to a handle - Possibility to avoid double type checking in expressions like this: if (myCurve->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) { Handle(Geom_BSplineCurve) aBSplCurve = Handle(Geom_BSplineCurve)::DownCast (myCurve); ... // work with bspline } this can be replaced by more compact and faster variant: if (const Geom_BSplineCurve* aBSplCurve = Handle(Geom_BSplineCurve)::DownCast (myCurve)) { ... // work with bspline } One drawback of returning a pointer is that it will break compatibility with existing code which now can use method IsNull() to the result of DownCast() to check if the value is of a goo type. Such checks however should be better replaced by equivalent check of IsNull() of original object followed by IsKind(). | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2015-07-03 10:37 |
|
New Issue | |
2015-07-03 10:37 |
|
Assigned To | => abv |
2015-12-14 22:39 |
|
Target Version | 7.0.0 => 7.1.0 |
2016-11-03 17:13 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-27 09:43 |
|
Target Version | 7.2.0 => 7.4.0 |
2017-08-14 11:14 |
|
Test case number | => Not required |
2017-10-09 13:39 |
|
Description Updated | |
2019-07-10 22:29 |
|
Target Version | 7.4.0 => 7.5.0 |
2020-09-11 16:13 |
|
Target Version | 7.5.0 => 7.6.0 |
2021-09-09 23:08 | kgv | Target Version | 7.6.0 => 7.7.0 |
2022-10-24 10:40 |
|
Target Version | 7.7.0 => 7.8.0 |
2023-08-01 15:08 | dpasukhi | Target Version | 7.8.0 => Unscheduled |