Changeset 79:b085e0bf42cf in rrlib_design_patterns


Ignore:
Timestamp:
07.08.2017 17:37:17 (16 months ago)
Author:
Tobias Föhst <foehst@…>
Branch:
14.08
Phase:
public
Tags:
tip
Message:

Adds method to list registered IDs from factories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/tFactory.h

    r65 r79  
    102102  } 
    103103 
     104  std::vector<TIdentifier> GetRegisteredIDs() const 
     105  { 
     106    std::vector<TIdentifier> keys; 
     107    for (const auto & entry : this->id_to_creator_map) 
     108    { 
     109      keys.emplace_back(entry.first); 
     110    } 
     111    return keys; 
     112  } 
     113 
    104114  template <typename ... TArguments> 
    105115  TAbstractProduct *Create(const TIdentifier &id, const TArguments &... arguments) const 
Note: See TracChangeset for help on using the changeset viewer.