make inheriting from Factory possible, thanks to Roland Pabel

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1066 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2009-12-22 11:35:46 +00:00
parent 21fadb7917
commit ead67fddf4

View file

@ -751,6 +751,7 @@ template <typename AP, typename Id, typename P1 >
>
class Factory : public FactoryErrorPolicy<IdentifierType, AbstractProduct>
{
protected:
typedef FactoryImpl< AbstractProduct, IdentifierType, CreatorParmTList > Impl;
typedef typename Impl::Parm1 Parm1;
@ -771,6 +772,7 @@ template <typename AP, typename Id, typename P1 >
typedef Functor<AbstractProduct*, CreatorParmTList> ProductCreator;
private:
typedef AssocVector<IdentifierType, ProductCreator> IdToProductMap;
IdToProductMap associations_;
@ -806,6 +808,11 @@ template <typename AP, typename Id, typename P1 >
return associations_.erase(id) != 0;
}
bool IsRegistered(const IdentifierType& id)
{
return associations_.find(id) != associations_.end();
}
std::vector<IdentifierType> RegisteredIds()
{
std::vector<IdentifierType> ids;