minor style improvement: replaced (type) casts with dynamic_cast<type>

This commit is contained in:
fgerlits 2006-08-30 16:14:49 +00:00
parent 8645db7358
commit f7a529d444
1 changed files with 12 additions and 10 deletions

View File

@ -211,7 +211,8 @@ GLiveSupport :: configure(const xmlpp::Element & element)
if (nodes.size() < 1) {
throw std::invalid_argument("no supportedLanguages element");
}
configSupportedLanguages(*((const xmlpp::Element*) nodes.front()));
configSupportedLanguages(
*dynamic_cast<const xmlpp::Element*>(nodes.front()));
// configure the resource bundle
nodes = element.get_children(LocalizedObject::getConfigElementName());
@ -219,7 +220,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
throw std::invalid_argument("no resourceBundle element");
}
LocalizedConfigurable::configure(
*((const xmlpp::Element*) nodes.front()));
*dynamic_cast<const xmlpp::Element*>(nodes.front()) );
// configure the AuthenticationClientFactory
nodes = element.get_children(
@ -229,7 +230,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
}
Ptr<AuthenticationClientFactory>::Ref acf
= AuthenticationClientFactory::getInstance();
acf->configure( *((const xmlpp::Element*) nodes.front()) );
acf->configure(*dynamic_cast<const xmlpp::Element*>(nodes.front()));
authentication = acf->getAuthenticationClient();
@ -239,7 +240,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
throw std::invalid_argument("no storageClientFactory element");
}
Ptr<StorageClientFactory>::Ref stcf = StorageClientFactory::getInstance();
stcf->configure( *((const xmlpp::Element*) nodes.front()) );
stcf->configure(*dynamic_cast<const xmlpp::Element*>(nodes.front()));
storage = stcf->getStorageClient();
@ -249,7 +250,8 @@ GLiveSupport :: configure(const xmlpp::Element & element)
throw std::invalid_argument("no widgetFactory element");
}
widgetFactory = WidgetFactory::getInstance();
widgetFactory->configure( *((const xmlpp::Element*) nodes.front()) );
widgetFactory->configure(
*dynamic_cast<const xmlpp::Element*>(nodes.front()) );
// configure the SchedulerClientFactory
nodes = element.get_children(
@ -259,7 +261,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
}
Ptr<SchedulerClientFactory>::Ref schcf
= SchedulerClientFactory::getInstance();
schcf->configure( *((const xmlpp::Element*) nodes.front()) );
schcf->configure(*dynamic_cast<const xmlpp::Element*>(nodes.front()));
scheduler = schcf->getSchedulerClient();
@ -302,7 +304,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
throw std::invalid_argument("no audioPlayer element");
}
apf = AudioPlayerFactory::getInstance();
apf->configure( *((const xmlpp::Element*) nodes.front()) );
apf->configure(*dynamic_cast<const xmlpp::Element*>(nodes.front()));
outputPlayer = apf->getAudioPlayer();
outputPlayer->initialize();
@ -319,7 +321,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
throw std::invalid_argument("no audioPlayer element");
}
apf = AudioPlayerFactory::getInstance();
apf->configure( *((const xmlpp::Element*) nodes.front()) );
apf->configure(*dynamic_cast<const xmlpp::Element*>(nodes.front()));
cuePlayer = apf->getAudioPlayer();
cuePlayer->initialize();
@ -357,7 +359,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
Ptr<ResourceBundle>::Ref metadataBundle = getBundle("metadataTypes");
metadataTypeContainer.reset(new MetadataTypeContainer(metadataBundle));
metadataTypeContainer->configure(
*((const xmlpp::Element*) nodes.front()) );
*dynamic_cast<const xmlpp::Element*>(nodes.front()) );
// configure the KeyboardShortcutList
nodes = element.get_children(
@ -367,7 +369,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
}
keyboardShortcutList.reset(new KeyboardShortcutList);
keyboardShortcutList->configure(
*((const xmlpp::Element*) nodes.front()) );
*dynamic_cast<const xmlpp::Element*>(nodes.front()) );
// save the configuration so we can modify it later
// TODO: move configuration code to the OptionsContainer class?