Switch to using enum

This commit is contained in:
bgbsww
2024-02-03 20:34:15 -05:00
committed by Chris Hennes
parent 32072c7f9c
commit 12fdd27326
2 changed files with 10 additions and 3 deletions

View File

@@ -67,6 +67,11 @@ public:
virtual std::string getName() const=0;
};
enum ElementMapResetPolicy
{
AllowNoMap,
ForceEmptyMap
};
/** ComplexGeoData Object
*/
@@ -265,8 +270,10 @@ public:
*
* @return Returns the existing element map.
*/
virtual ElementMapPtr resetElementMap(ElementMapPtr elementMap=ElementMapPtr(), bool forceEmpty=false) {
if ( ! elementMap && ! forceEmpty ) {
virtual ElementMapPtr resetElementMap(ElementMapPtr elementMap = ElementMapPtr(),
ElementMapResetPolicy forceEmpty = ForceEmptyMap)
{
if (!elementMap && forceEmpty == ForceEmptyMap) {
elementMap = std::make_shared<Data::ElementMap>();
}
_elementMap.swap(elementMap);

View File

@@ -444,7 +444,7 @@ TEST_F(ComplexGeoDataTest, saveDocFileWithNoElementMap)
{
// Arrange
Base::StringWriter writer;
cgd().resetElementMap(nullptr, true); // Force undefined map
cgd().resetElementMap(nullptr, Data::AllowNoMap); // Force undefined map
// Act
cgd().SaveDocFile(writer);