Recently I read the source code of leveldb, but I am confuse about the rep struct in the table and table_builder source.
since we can directly store the member variable directly in the class Table and class TableBuilder.
But why the author make a struct Rep, and store the member variable in the struct Rep.
I can come up whit one reason, because the table and table_builder will expose to the user, so we want to hidden the implementation. Is it right? or there is some other idea that I miss, or is it some design pattern?
Thank you
Aucun commentaire:
Enregistrer un commentaire