1

Is there a particular word that represents an individual item within a cache, particularly from a programming perspective?

Is item the best choice in this particular context? Or do you generally need to know the type of objects within a cache (i.e. [object] cache) to refer to them any other way? For example:

Weapon cache - contains individual weapons.

Entity cache - contains individual entities.

4 Answers 4

4

Not really - you already have two conflicting answers, and I would have said Entry myself.

A cache is just a container, and doesn't say much about what you put inside. Would you expect a common term for things in a bag?

If you have to refer to the items stored in the cache without describing (or repeating) their type, pick one of entry, value, item or similar, and just stick with it. It'll be clear enough.

3
  • I agree with all of this (and I also would have said entry). Jan 30, 2012 at 18:13
  • "...pick one of entry, value, item or similar" may not apply in most cases and therefore cannot "just stick with it". And you probably meant entity, not entry, which don't fit either.
    – Kris
    Jan 31, 2012 at 11:54
  • Nope, I definitely meant entry: from it's common use denoting an individual item in a list or table of data, it seems to generalise well to membership of an arbitrary container.
    – Useless
    Jan 31, 2012 at 12:01
2

The individual items in a cache may be called elements of the cache.

return cache->c_ops;
 * Return the first element in the cache  

return nl_list_entry(cache->c_items.next, struct nl_object, ce_list);
 * Return the last element in the cache

return nl_list_entry(cache->c_items.prev, struct nl_object, ce_list);
 * Return the next element in the cache 

return nl_list_entry(obj->ce_list.next, struct nl_object, ce_list);
 * Return the previous element in the cache

That may help.

1

Information or item. http://en.wikipedia.org/wiki/Cache_algorithms

1

They are referred to as values in the implementations I'm familiar with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.