Sample Namespace Implementation: oaNative to oaWinNS


The following example shows the flow when converting a scalar name string from the oaNative namespace to a name string in the Windows name space (oaWinNS). This flow uses the getType() function to implement the name type and the get() function to implement the name strings.

  1. Implement the code that checks the name type. Because the Windows namespace only supports scalar names, throw an exception for all other name types.


  2. Once you have a valid name type, implement code that determines if the name string is an escaped keyword.


  3. If a name string is not a keyword, check each character in the name to determine if it is a valid character in the oaWinNS namespace. Character validation follows the flow shown in the figure below. Because bus characters are not allowed in the Windows namespace, oaNative throws an exception if an oaNative bus character is found in the name string. Case sensitivity is considered when validating the keywords as well as when validating each character.


Converting oaNative name string to oaWinNS





Return to Deriving Namespaces



Copyright © 2001-2010 Cadence Design Systems, Inc.
All rights reserved.