Helper-class to resolve owner and group ids to strings names. The class uses an instance of LRUCacheTable of size 10 for each value to increase the performance of the lookup. Because of this and the fact that the returned string value is located in an internal member buffer, multithreaded invocations of members GetOwnerName and GetGroupName have to be protected against racing conditions. This is up to the user of the type.
Definition at line 243 of file ftvalue.hpp.
#include <ftvalue.hpp>
Public Method Index: | |
| OwnerAndGroupResolver (PoolAllocator &poolAllocator) | |
| const NString | GetGroupName (const FileStatus &descriptor) const |
| const NString | GetOwnerName (const FileStatus &descriptor) const |
| void | SetGroupCacheCapacity (integer numberOfLists, integer entriesPerList) |
| void | SetOwnerCacheCapacity (integer numberOfLists, integer entriesPerList) |
|
inline |
Constructor.
| poolAllocator | The allocator passed to the internal instances of type LRUCacheTable. |
Definition at line 261 of file ftvalue.hpp.
| const NString alib::filetree::OwnerAndGroupResolver::GetGroupName | ( | const FileStatus & | descriptor | ) | const |
Retrieves the file's group name.
| descriptor | The file to examine. |
Definition at line 39 of file ftvalue.cpp.
| const NString alib::filetree::OwnerAndGroupResolver::GetOwnerName | ( | const FileStatus & | descriptor | ) | const |
Retrieves the file's owner's name.
| descriptor | The file to examine. |
Definition at line 24 of file ftvalue.cpp.
| void alib::filetree::OwnerAndGroupResolver::SetGroupCacheCapacity | ( | integer | numberOfLists, |
| integer | entriesPerList ) |
Changes the capacity of the LRUCacheTable for owner names, by calling void Reserve(integer, integer) .
The default sizes with construction is 6 for both values.
| numberOfLists | The number of LRU-lists to use. |
| entriesPerList | The maximum length of each cache list. |
| void alib::filetree::OwnerAndGroupResolver::SetOwnerCacheCapacity | ( | integer | numberOfLists, |
| integer | entriesPerList ) |
Changes the capacity of the LRUCacheTable for owner names, by calling void Reserve(integer, integer) .
The default sizes with construction is 6 for both values.
| numberOfLists | The number of LRU-lists to use. |
| entriesPerList | The maximum length of each cache list. |