lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 8c86c6d 1/7: Prefer '_' suffix to 'm_' prefix


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 8c86c6d 1/7: Prefer '_' suffix to 'm_' prefix for data members
Date: Sat, 24 Feb 2018 04:53:13 -0500 (EST)

branch: master
commit 8c86c6d5bdd33f69624a9e1d389290e279fa5814
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Prefer '_' suffix to 'm_' prefix for data members
    
    Also changed "scaling" to "scale" in altered names, for uniformity.
    
    The name scale_factor_ is also used in class scaled_image_cell, but it
    nominates distinct private members in distinct classes: no clash there.
---
 ledger_base.cpp | 28 ++++++++++++++--------------
 ledger_base.hpp |  4 ++--
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/ledger_base.cpp b/ledger_base.cpp
index a01fdbf..e76a3cc 100644
--- a/ledger_base.cpp
+++ b/ledger_base.cpp
@@ -35,16 +35,16 @@
 
 //============================================================================
 LedgerBase::LedgerBase(int a_Length)
-    :m_scaling_factor(1.0)
-    ,m_scale_unit("")
+    :scale_factor_(1.0)
+    ,scale_unit_  ("")
 {
     Initialize(a_Length);
 }
 
 //============================================================================
 LedgerBase::LedgerBase(LedgerBase const& obj)
-    :m_scaling_factor(obj.m_scaling_factor)
-    ,m_scale_unit(obj.m_scale_unit)
+    :scale_factor_(obj.scale_factor_)
+    ,scale_unit_  (obj.scale_unit_)
 {
     Initialize(obj.GetLength());
     Copy(obj);
@@ -223,8 +223,8 @@ LedgerBase& LedgerBase::PlusEq
     ,std::vector<double> const& a_Inforce
     )
 {
-    LMI_ASSERT(0.0 != m_scaling_factor);
-    if(m_scaling_factor != a_Addend.m_scaling_factor)
+    LMI_ASSERT(0.0 != scale_factor_);
+    if(scale_factor_ != a_Addend.scale_factor_)
         {
         alarum() << "Cannot add differently scaled ledgers." << LMI_FLUSH;
         }
@@ -411,22 +411,22 @@ namespace
 void LedgerBase::ApplyScaleFactor(double a_Mult)
 {
     LMI_ASSERT(0.0 != a_Mult);
-    LMI_ASSERT(0.0 != m_scaling_factor);
-    if(1.0 != m_scaling_factor)
+    LMI_ASSERT(0.0 != scale_factor_);
+    if(1.0 != scale_factor_)
         {
         alarum() << "Cannot scale the same ledger twice." << LMI_FLUSH;
         }
 
-    m_scaling_factor = a_Mult;
-    if(1.0 == m_scaling_factor)
+    scale_factor_ = a_Mult;
+    if(1.0 == scale_factor_)
         {
         // Don't waste time multiplying all these vectors by one
         return;
         }
-    m_scale_unit = look_up_scale_unit(m_scaling_factor);
+    scale_unit_ = look_up_scale_unit(scale_factor_);
 
     // ET !! *i.second *= M;
-    std::vector<double>M(GetLength(), m_scaling_factor);
+    std::vector<double>M(GetLength(), scale_factor_);
     for(auto& i : ScalableVectors)
         {
         std::vector<double>& v = *i.second;
@@ -443,13 +443,13 @@ void LedgerBase::ApplyScaleFactor(double a_Mult)
 //============================================================================
 std::string const& LedgerBase::ScaleUnit() const
 {
-    return m_scale_unit;
+    return scale_unit_;
 }
 
 //============================================================================
 double LedgerBase::ScaleFactor() const
 {
-    return m_scaling_factor;
+    return scale_factor_;
 }
 
 //============================================================================
diff --git a/ledger_base.hpp b/ledger_base.hpp
index 47536df..d1f6645 100644
--- a/ledger_base.hpp
+++ b/ledger_base.hpp
@@ -230,8 +230,8 @@ class LMI_SO LedgerBase
     string_map          Strings;
 
   private:
-    double              m_scaling_factor;
-    std::string         m_scale_unit; // E.g. "thousands", "millions".
+    double              scale_factor_;
+    std::string         scale_unit_; // E.g. "thousands", "millions".
 };
 
 template<typename T> void SpewVector



reply via email to

[Prev in Thread] Current Thread [Next in Thread]