App/Toponaming: Minor code cleanup

This commit is contained in:
Chris Hennes
2023-09-13 09:25:22 -05:00
parent 2a386c9f6f
commit b8055fa6f4
4 changed files with 17 additions and 16 deletions

View File

@@ -1056,6 +1056,7 @@ std::pair<bool,int> Document::addStringHasher(const StringHasherRef & hasher) co
StringHasherRef Document::getStringHasher(int idx) const {
if(idx<0) {
return d->Hasher;
return d->Hasher;
}
StringHasherRef hasher;

View File

@@ -51,7 +51,7 @@ namespace App
class Application;
class Transaction;
class StringHasher;
typedef Base::Reference<StringHasher> StringHasherRef;
using StringHasherRef = Base::Reference<StringHasher>;
}
namespace App
@@ -476,11 +476,11 @@ public:
/** Called by property during properly save its containing StringHasher
*
* @param hasher: the input hasher
* @return Returns a pair<bool,int>. Boolean member indicate if the
* StringHasher has been saved before. The Integer is the hasher index.
* @return Returns a pair<bool,int>. The boolean indicates if the
* StringHasher has been saved before. The integer is the hasher index.
*
* The StringHasher object is designed to be shared among multiple objects.
* So, we must not save duplicate copies of the same hasher. And must be
* We must not save duplicate copies of the same hasher, and must be
* able to restore with the same sharing relationship. This function returns
* whether the hasher has been saved before by other objects, and the index
* of the hasher. If the hasher has not been saved before, the object must
@@ -495,9 +495,8 @@ public:
*
* @return Return the resulting string hasher.
*
* The caller is responsible to restore the hasher itself if it is the first
* owner of the hasher, i.e. return addStringHasher() returns true during
* save
* The caller is responsible for restoring the hasher if the caller is the first
* owner of the hasher, i.e. if addStringHasher() returns true during save.
*/
StringHasherRef getStringHasher(int index=-1) const;

View File

@@ -221,16 +221,16 @@ PropertyData PropertyContainer::propertyData;
void PropertyContainer::beforeSave() const
{
std::map<std::string,Property*> Map;
std::map<std::string, Property*> Map;
getPropertyMap(Map);
for(auto &entry : Map) {
for (auto& entry : Map) {
auto prop = entry.second;
if(!prop->testStatus(Property::PropDynamic)
&& (prop->testStatus(Property::Transient) ||
getPropertyType(prop) & Prop_Transient))
{
if (!prop->testStatus(Property::PropDynamic)
&& (prop->testStatus(Property::Transient)
|| ((getPropertyType(prop) & Prop_Transient) != 0))) {
// Nothing
} else {
}
else {
prop->beforeSave();
}
}
@@ -254,8 +254,9 @@ void PropertyContainer::Save (Base::Writer &writer) const
{
transients.push_back(prop);
it = Map.erase(it);
}else
} else {
++it;
}
}
writer.incInd(); // indentation for 'Properties Count'

View File

@@ -50,7 +50,7 @@ using Node = std::vector <size_t>;
using Path = std::vector <size_t>;
namespace App {
typedef boost::bimap<StringHasherRef,int> HasherMap;
using HasherMap = boost::bimap<StringHasherRef, int>;
class Transaction;
// Pimpl class