Hi,
I had been using the Code from Alexandrescu's book and now use loki-0.1.5 . Nice improvements, but one problem :
I subclass Factory to implement an easier Register() function and other stuff, but this won't compile because the typedef's (ProductCreator and IdToProductMap along with the ParmX list) are private in class Factory. (They are not in Functor.)
I'd also like to see
IdToProductMap associations_;
declared protected so it would be possible to access it, e.g. I implement in my subclass
bool Contains(const IdentifierType& id) {
return( dep::associations_.find( id ) != dep::associations_.end() );
}
If you think this would be a good change, I can send a patch.
thanks,
Roland
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Roland,
I could imagine initially Andrei didn't thought that someone would like to subclass Factory. But I don't see a reason why we should forbid it. So I think we could change this.
And I think we could add "Contains" to loki's factory. Do you then still need associations_ as protected? I'm only no 100% about the name Contains.
Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Peter,
If we would add the method to Factory then I wouldn't need associations_ to be protected.
Maybe better names are "HasId" or "IdRegistered" ( IdRegistered might be confused with std::vector<...> RegisteredIds() ).
cu
Roland
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I had been using the Code from Alexandrescu's book and now use loki-0.1.5 . Nice improvements, but one problem :
I subclass Factory to implement an easier Register() function and other stuff, but this won't compile because the typedef's (ProductCreator and IdToProductMap along with the ParmX list) are private in class Factory. (They are not in Functor.)
I'd also like to see
IdToProductMap associations_;
declared protected so it would be possible to access it, e.g. I implement in my subclass
bool Contains(const IdentifierType& id) {
return( dep::associations_.find( id ) != dep::associations_.end() );
}
If you think this would be a good change, I can send a patch.
thanks,
Roland
Hi Roland,
I could imagine initially Andrei didn't thought that someone would like to subclass Factory. But I don't see a reason why we should forbid it. So I think we could change this.
And I think we could add "Contains" to loki's factory. Do you then still need associations_ as protected? I'm only no 100% about the name Contains.
Peter
Hi Peter,
If we would add the method to Factory then I wouldn't need associations_ to be protected.
Maybe better names are "HasId" or "IdRegistered" ( IdRegistered might be confused with std::vector<...> RegisteredIds() ).
cu
Roland