Archived issue #0029385
OCAF - TDataStd_IntPackedMap lacks interface to set map as TColStd_PackedMapOfInteger
Description
TDataStd_IntPackedMap provides interface to access stored map as both const TColStd_PackedMapOfInteger& and Handle(TColStd_HPackedMapOfInteger); however, method ChangeMap() accepts only Handle(TColStd_HPackedMapOfInteger). This means that to set map available as TColStd_PackedMapOfInteger I need to create intermediate TColStd_HPackedMapOfInteger which is inefficient. It would be logical to have interface for setting the map accepting const TColStd_PackedMapOfInteger&
Steps to reproduce
N/A
Public activity
11 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: szy
Date: Thu Dec 28 16:53:41 2017 +0300
0029385: OCAF - TDataStd_IntPackedMap lacks interface to set map as TColStd_PackedMapOfInteger.
Added method ChangeMap (const TColStd_PackedMapOfInteger& theMap).
[revision removed]
Detailed log of new commits:
Author: szy
Date: Thu Dec 28 16:53:41 2017 +0300
0029385: OCAF - TDataStd_IntPackedMap lacks interface to set map as TColStd_PackedMapOfInteger.
Added method ChangeMap (const TColStd_PackedMapOfInteger& theMap).
The interface is extended. The requested additional method
Standard_Boolean ChangeMap (const TColStd_PackedMapOfInteger& theMap)
is added.
Tested:
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Windows-64-VC10-opt-tests-compare-windows/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Debian70-64-opt-tests-compare-linux/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Windows-64-VC10-opt-tests-compare-windows/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Debian70-64-opt-tests-compare-linux/1/
The last test Products-Debian70 has 1 failure (omf misc license) which has no any connection with the current patch.
Standard_Boolean ChangeMap (const TColStd_PackedMapOfInteger& theMap)
is added.
Tested:
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Windows-64-VC10-opt-tests-compare-windows/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Debian70-64-opt-tests-compare-linux/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Windows-64-VC10-opt-tests-compare-windows/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Debian70-64-opt-tests-compare-linux/1/
The last test Products-Debian70 has 1 failure (omf misc license) which has no any connection with the current patch.
In the method TDataStd_IntPackedMap::ChangeMap
it seems the first condition is useless:
if(theMap.IsEmpty()) return Standard_False;
It must be possible to set the empty map and it must change the content of an attribute.
it seems the first condition is useless:
if(theMap.IsEmpty()) return Standard_False;
It must be possible to set the empty map and it must change the content of an attribute.
In fact this behavior is already implemented in method TDataStd_IntPackedMap::Clear () which cleans current map.
I.e. the map becomes empty exactly as you noticed. I think that adding the second possibility to set empty map looks as extra.
I.e. the map becomes empty exactly as you noticed. I think that adding the second possibility to set empty map looks as extra.
I cannot agree: if I call ChangeMap(), I want the attribute to store exactly the map I given as argument. The map can contain any number of items, including zero. It should be stored as well.
I agree with Andrey: it is unexpected behavior if the user calls ChangeMap, but it does nothing.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: szy
Date: Thu Dec 28 16:53:41 2017 +0300
0029385: OCAF - TDataStd_IntPackedMap lacks interface to set map as TColStd_PackedMapOfInteger
// ChangeMap with empty map is allowed.
0029385: OCAF - TDataStd_IntPackedMap lacks interface to set map as TColStd_PackedMapOfInteger.
Added method ChangeMap (const TColStd_PackedMapOfInteger& theMap).
[revision removed]
Detailed log of new commits:
Author: szy
Date: Thu Dec 28 16:53:41 2017 +0300
0029385: OCAF - TDataStd_IntPackedMap lacks interface to set map as TColStd_PackedMapOfInteger
// ChangeMap with empty map is allowed.
0029385: OCAF - TDataStd_IntPackedMap lacks interface to set map as TColStd_PackedMapOfInteger.
Added method ChangeMap (const TColStd_PackedMapOfInteger& theMap).
Fixed and tested. Review, please.
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Windows-64-VC10-opt-tests-compare-windows/3/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Debian70-64-opt-tests-compare-linux/3/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Windows-64-VC10-opt-tests-compare-windows/3/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Debian70-64-opt-tests-compare-linux/3/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Windows-64-VC10-opt-tests-compare-windows/3/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-OCCT-Debian70-64-opt-tests-compare-linux/3/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Windows-64-VC10-opt-tests-compare-windows/3/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29385-master-szy-Products-Debian70-64-opt-tests-compare-linux/3/
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.
Number of compiler warnings:
No new/fixed warnings
Regressions/Differences/Improvements:
No regressions/differences
CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18554.749999999753 / 18498.959999999654 [+0.30%]
Products
Total CPU difference: 7488.03999999999 / 7484.560000000007 [+0.05%]
Windows-64-VC10:
OCCT
Total CPU difference: 18025.9155499985 / 17960.90993329856 [+0.36%]
Products
Total CPU difference: 8059.042860199995 / 8020.448212799986 [+0.48%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.
Number of compiler warnings:
No new/fixed warnings
Regressions/Differences/Improvements:
No regressions/differences
CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18554.749999999753 / 18498.959999999654 [+0.30%]
Products
Total CPU difference: 7488.03999999999 / 7484.560000000007 [+0.05%]
Windows-64-VC10:
OCCT
Total CPU difference: 18025.9155499985 / 17960.90993329856 [+0.36%]
Products
Total CPU difference: 8059.042860199995 / 8020.448212799986 [+0.48%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]