bool Encode(uchar symbol, Output& result) { if(symbol == ' ') { LoadFromAddress(AddressOf(Space), result); return true; } if(!ConvertSymbol(symbol, symbol)) { return false; } LoadFromAddress(AddressOf(MorseTable[symbol - '0']), result); return true; }
////////////////////////////////////////////////////////////////////////////// // Checks if a style is already cached and returns it if it is. // Otherwise evaluates a style and if it is constant, caches it // in a hashtable. void PointAdapter::ObtainStyle(MdfModel::PointSymbolization2D* psym, RS_MarkerDef& mdef) { RS_MarkerDef* cachedStyle = m_hPointSymCache[psym]; if (cachedStyle) { mdef = *cachedStyle; } else { bool cacheable = ConvertSymbol(psym->GetSymbol(), mdef); if (cacheable) { RS_MarkerDef* rsmdef = new RS_MarkerDef(); *rsmdef = mdef; m_hPointSymCache[psym] = rsmdef; } } }