why table and tablebuilder in leveldb use struct rep?

40 views
Skip to first unread message

陈宗志

unread,
Oct 25, 2015, 9:00:14 AM10/25/15
to leveldb
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

Reply all
Reply to author
Forward
0 new messages