parameters: (self, sEnumTypeNm, oEnumValue, fTypePrefix = False)
return_statement: return '%s_Unknown_%s' % (sEnumTypeNm, oEnumValue)
docstring: Returns the name (string) for the corresponding enum value.
docstring_summary: Returns the name (string) for the corresponding enum value.
docstring_tokens: Returns the name ( string ) for the corresponding enum value .
function: def getEnumValueName(self, sEnumTypeNm, oEnumValue, fTypePrefix = False):
          """
          Returns the name (string) for the corresponding enum value.
          """
          # Cache lookup:
          dValueNames = self._ddEnumValueToName.get(sEnumTypeNm);
          if dValueNames is not None:
              sValueName = dValueNames.get(oEnumValue);
              if sValueName:
                  return sValueName if not fTypePrefix else '%s_%s' % (sEnumTypeNm, sValueName);
          else:
              # Cache miss. Build the reverse lookup dictionary and add it to the cache:
              dNamedValues = self.constants.all_values(sEnumTypeNm);
              if len(dNamedValues) > 0:
  
                  dValueNames = dict();
                  for sName in dNamedValues:
                      dValueNames[dNamedValues[sName]] = sName;
                  self._ddEnumValueToName[sEnumTypeNm] = dValueNames;
  
                  # Lookup the value:
                  sValueName = dValueNames.get(oEnumValue);
                  if sValueName:
                      return sValueName if not fTypePrefix else '%s_%s' % (sEnumTypeNm, sValueName);
  
          # Fallback:
          return '%s_Unknown_%s' % (sEnumTypeNm, oEnumValue);
function_tokens: def getEnumValueName ( self , sEnumTypeNm , oEnumValue , fTypePrefix = False ) : # Cache lookup: dValueNames = self . _ddEnumValueToName . get ( sEnumTypeNm ) if dValueNames is not None : sValueName = dValueNames . get ( oEnumValue ) if sValueName : return sValueName if not fTypePrefix else '%s_%s' % ( sEnumTypeNm , sValueName ) else : # Cache miss. Build the reverse lookup dictionary and add it to the cache: dNamedValues = self . constants . all_values ( sEnumTypeNm ) if len ( dNamedValues ) > 0 : dValueNames = dict ( ) for sName in dNamedValues : dValueNames [ dNamedValues [ sName ] ] = sName self . _ddEnumValueToName [ sEnumTypeNm ] = dValueNames # Lookup the value: sValueName = dValueNames . get ( oEnumValue ) if sValueName : return sValueName if not fTypePrefix else '%s_%s' % ( sEnumTypeNm , sValueName ) # Fallback: return '%s_Unknown_%s' % ( sEnumTypeNm , oEnumValue )