mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-29 12:45:22 +01:00
integrated changes from main rep
This commit is contained in:
parent
3941965bce
commit
4a68362f6c
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Application.h
|
||||
//
|
||||
// $Id: //poco/1.3/Util/include/Poco/Util/Application.h#2 $
|
||||
// $Id: //poco/1.3/Util/include/Poco/Util/Application.h#3 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@ -50,6 +50,7 @@
|
||||
#include "Poco/Timestamp.h"
|
||||
#include "Poco/Timespan.h"
|
||||
#include <vector>
|
||||
#include <typeinfo>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -378,11 +379,11 @@ template <class C> C& Application::getSubsystem() const
|
||||
{
|
||||
for (SubsystemVec::const_iterator it = _subsystems.begin(); it != _subsystems.end(); ++it)
|
||||
{
|
||||
Poco::AutoPtr<C> pSubsystem(it->cast<C>());
|
||||
if (!pSubsystem.isNull())
|
||||
return *pSubsystem;
|
||||
const Subsystem* pSS(it->get());
|
||||
const C* pC = dynamic_cast<const C*>(pSS);
|
||||
if (pC) return *const_cast<C*>(pC);
|
||||
}
|
||||
throw Poco::NotFoundException("The subsystem has not been registered");
|
||||
throw Poco::NotFoundException("The subsystem has not been registered", typeid(C).name());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user