Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6151)

Issue 3597041: Review: getattribute for stats (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by larrygritz
Modified:
13 years, 4 months ago
Reviewers:
lg, Chris Foster, oiio-dev
Base URL:
http://svn.openimageio.org/oiio/trunk/
Visibility:
Public.

Description

Refactor ImageCache::getattribute and in the process make it so that we can retrieve all the statistics individually. This is especially handy for two immediate uses: (1) makes it easier for apps to ask OIIO how much cache memory it has actually used, directly, without having to ask for full stats as a string and parse it; (2) makes it easier to write unit tests that expect a particular stat to have a certain value to confirm that something is working properly.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -39 lines) Patch
src/libtexture/imagecache.cpp View 2 chunks +47 lines, -39 lines 1 comment Download

Messages

Total messages: 3
larrygritz
13 years, 4 months ago (2010-12-11 20:53:06 UTC) #1
Chris Foster
LGTM http://codereview.appspot.com/3597041/diff/1/src/libtexture/imagecache.cpp File src/libtexture/imagecache.cpp (right): http://codereview.appspot.com/3597041/diff/1/src/libtexture/imagecache.cpp#newcode1647 src/libtexture/imagecache.cpp:1647: if (! strncmp (name.c_str(), "stat:", 5)) { How ...
13 years, 4 months ago (2010-12-15 05:56:03 UTC) #2
lg_larrygritz.com
13 years, 4 months ago (2010-12-15 07:24:07 UTC) #3
Will do.


On Dec 14, 2010, at 9:56 PM, chris42f@gmail.com wrote:

> LGTM
> 
> 
> http://codereview.appspot.com/3597041/diff/1/src/libtexture/imagecache.cpp
> File src/libtexture/imagecache.cpp (right):
> 
>
http://codereview.appspot.com/3597041/diff/1/src/libtexture/imagecache.cpp#ne...
> src/libtexture/imagecache.cpp:1647: if (! strncmp (name.c_str(),
> "stat:", 5)) {
> How about the following
> 
> if(boost::starts_with(name, "stat:"))
> 
> included from boost/algorithm/string/predicate.hpp.  (There's also
> std::string::compare(), but it's no clearer than the strncmp version.)
> 
> http://codereview.appspot.com/3597041/
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
lg@larrygritz.com


Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b