| 2061 | //----------------------------------------------------------------------------- |
| 2062 | |
| 2063 | void SimObject::setClassNamespace( const char *classNamespace ) |
| 2064 | { |
| 2065 | StringTableEntry oldClassNamespace = mClassName; |
| 2066 | StringTableEntry newClassNamespace = StringTable->insert( classNamespace ); |
| 2067 | |
| 2068 | if( oldClassNamespace == newClassNamespace ) |
| 2069 | return; |
| 2070 | |
| 2071 | if( isProperlyAdded() ) |
| 2072 | unlinkNamespaces(); |
| 2073 | |
| 2074 | mClassName = newClassNamespace; |
| 2075 | |
| 2076 | if( isProperlyAdded() ) |
| 2077 | { |
| 2078 | linkNamespaces(); |
| 2079 | |
| 2080 | // Restore old namespace setup if linkage failed. |
| 2081 | |
| 2082 | if( mClassName != newClassNamespace ) |
| 2083 | { |
| 2084 | mClassName = oldClassNamespace; |
| 2085 | linkNamespaces(); |
| 2086 | } |
| 2087 | } |
| 2088 | } |
| 2089 | |
| 2090 | //----------------------------------------------------------------------------- |
| 2091 |
no test coverage detected