Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //current way to setup the options
- std::map<std::string, size_t> options; //public data member
- options["num_images"] = 2;
- options["row_size"] = 321;
- options["col_size"] = 481;
- options["rgbd"] = 0;
- options["shrink"] = 2;
- //if we change it to member function, we could
- //1 : set std::map<std::string, size_t> options as private data member or store each option as a data member, your choice.
- //I do not think these options will be the performance bottleneck.I prefer map in this case, because we can reduce the codes
- //the codes we need to change yet make the api easier to use
- //2 : let user read, set the options by member function
- void NumImages(size_t value){ options["num_images"] = value; };
- void RowSize(size_t value){ options["row_size"] = value; };
- void ColSize(size_t value){ options["col_size"] = value; };
- //or
- void NumImages(size_t value){ numImages = value; };
- void RowSize(size_t value){ rowSize = value; };
- void ColSize(size_t value){ colSize = value; };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement