Menu

patch to add IsRegistered() method to Factory

Developers
2015-01-21
2015-01-22
  • Nicholas Leippe

    Nicholas Leippe - 2015-01-21

    In a project I did using loki, adding the following simple patch proved necessary:

    ---------------------------- include/loki/Factory.h ----------------------------
    index c4c3b22..cf6ab61 100644
    @@ -817,6 +817,12 @@ template <typename AP, typename Id, typename P1 >
                 return ids;
             }
    
    +   bool IsRegistered(const IdentifierType& id) const
    +   {
    +            typename IdToProductMap::const_iterator i = associations_.find(id);
    +            return i != associations_.end();
    +   }
    +
             AbstractProduct* CreateObject(const IdentifierType& id)
             {
                 typename IdToProductMap::iterator i = associations_.find(id);
    
     
  • Guillaume CHATELET

    Can you inline i ?

     

Log in to post a comment.