[dasher] Removed many methods from NCManager that simply delegate to the alphabet



commit 517eac7db6bf0def093e98f591b045242af190e2
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Sat Nov 21 17:57:50 2009 +0000

    Removed many methods from NCManager that simply delegate to the alphabet
    (GetSpaceSymbol, GetControlSymbol, GetColour, GetStartConversionSymbol;
     also GetDisplayText - unused!)

 Src/DasherCore/AlphabetManager.cpp   |    8 +++---
 Src/DasherCore/MandarinAlphMgr.cpp   |    2 +-
 Src/DasherCore/NodeCreationManager.h |   36 ----------------------------------
 3 files changed, 5 insertions(+), 41 deletions(-)
---
diff --git a/Src/DasherCore/AlphabetManager.cpp b/Src/DasherCore/AlphabetManager.cpp
index 5272e13..7ea26ff 100644
--- a/Src/DasherCore/AlphabetManager.cpp
+++ b/Src/DasherCore/AlphabetManager.cpp
@@ -198,7 +198,7 @@ CDasherNode *CAlphabetManager::CreateSymbolNode(CAlphNode *pParent, symbol iSymb
 
     }
     // TODO: Need to fix fact that this is created even when control mode is switched off
-    else if(iSymbol == m_pNCManager->GetControlSymbol()) {
+    else if(iSymbol == m_pNCManager->GetAlphabet()->GetControlSymbol()) {
       //ACL setting offset as one more than parent for consistency with "proper" symbol nodes...
       pNewNode = m_pNCManager->GetCtrlRoot(pParent, iLbnd, iHbnd, pParent->m_iOffset+1); 
 
@@ -211,7 +211,7 @@ CDasherNode *CAlphabetManager::CreateSymbolNode(CAlphNode *pParent, symbol iSymb
       DASHER_ASSERT(pNewNode);
 #endif
     }
-    else if(iSymbol == m_pNCManager->GetStartConversionSymbol()) {
+    else if(iSymbol == m_pNCManager->GetAlphabet()->GetStartConversionSymbol()) {
       //  else if(iSymbol == m_pNCManager->GetSpaceSymbol()) {
 
       //ACL setting m_iOffset+1 for consistency with "proper" symbol nodes...
@@ -219,7 +219,7 @@ CDasherNode *CAlphabetManager::CreateSymbolNode(CAlphNode *pParent, symbol iSymb
     }
     else {
       int iPhase = (pParent->iPhase + 1) % 2;
-      int iColour = m_pNCManager->GetColour(iSymbol, iPhase);
+      int iColour = m_pNCManager->GetAlphabet()->GetColour(iSymbol, iPhase);
 
       // TODO: Exceptions / error handling in general
 
@@ -395,7 +395,7 @@ CDasherNode *CAlphabetManager::CAlphNode::RebuildParent() {
 
     pDisplayInfo->strDisplayText = m_pMgr->m_pNCManager->GetAlphabet()->GetDisplayText(iNewSymbol);
   }
-  pDisplayInfo->iColour = m_pMgr->m_pNCManager->GetColour(iNewSymbol, iNewPhase);
+  pDisplayInfo->iColour = m_pMgr->m_pNCManager->GetAlphabet()->GetColour(iNewSymbol, iNewPhase);
 
   CAlphNode *pNewNode = m_pMgr->makeNode(NULL, 0, 0, pDisplayInfo);
   
diff --git a/Src/DasherCore/MandarinAlphMgr.cpp b/Src/DasherCore/MandarinAlphMgr.cpp
index ada6b56..601f715 100644
--- a/Src/DasherCore/MandarinAlphMgr.cpp
+++ b/Src/DasherCore/MandarinAlphMgr.cpp
@@ -65,7 +65,7 @@ CAlphabetManager::CAlphNode *CMandarinAlphMgr::GetRoot(CDasherNode *pParent, int
     pNewNode->m_iOffset=max(0,iOffset)-1;
     pNewNode->iPhase=0;
     pNewNode->iSymbol=0;
-    pNewNode->pLanguageModel = m_pLanguageModel;    
+    pNewNode->pLanguageModel = m_pLanguageModel;
   } else {
     //probably rebuilding parent; call standard GetRoot, which'll extract the most recent symbol
     // (entered by the node (equivalent to that) which we are rebuilding)
diff --git a/Src/DasherCore/NodeCreationManager.h b/Src/DasherCore/NodeCreationManager.h
index 5524272..43db392 100644
--- a/Src/DasherCore/NodeCreationManager.h
+++ b/Src/DasherCore/NodeCreationManager.h
@@ -56,42 +56,6 @@ class CNodeCreationManager : public Dasher::CDasherComponent {
 
   void GetProbs(Dasher::CLanguageModel::Context context, std::vector <Dasher::symbol >&NewSymbols, std::vector <unsigned int >&Probs, int iNorm) const;
 
-  inline int GetColour(Dasher::symbol s, int iPhase) const {
-    return m_pAlphabet->GetColour(s, iPhase); 
-  };
-
-  ///
-  /// Get the symbol ID representing space
-  ///
-
-  Dasher::symbol GetSpaceSymbol() const {
-    return m_pAlphabet->GetSpaceSymbol();
-  }
-
-  ///
-  /// Get the symbol ID representing the control node 
-  ///
-
-  Dasher::symbol GetControlSymbol() const {
-    return m_pAlphabet->GetControlSymbol();
-  }
-
-  ///
-  /// Get the symbol ID representing the conversion pseudo-character
-  ///
-
-  Dasher::symbol GetStartConversionSymbol() const {
-    return m_pAlphabet->GetStartConversionSymbol();
-  }
-
-  ///
-  /// Convert a given symbol ID to display text
-  ///
-
-  const std::string & GetDisplayText(int iSymbol) const {
-    return m_pAlphabet->GetDisplayText(iSymbol);
-  }
-
   ///
   /// Get a reference to the alphabet
   ///



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