A non-POD version of "struct group" for thread- and memory-safe data access.
Wraps the contents of a "struct group" instance to a non-POD object containing RAII-style data (e.g. OFString instead of const char*). To handle the old pointer behavior, OFGroup objects can have an invalid state in which case all members are undefined. You can test whether an OFGroup object is invalid or not with the overloaded operators "operator !" and "operator OFBool". Therefore, it behaves quite the same way as pointers in this regard.
- Note
- The downside of this non-POD class is that it leads to some unnecessary string copy operations. The resulting performance penalty should be insignificant. However, implementing this class based on auto_ptr / unique_ptr or using c++11 move semantics would prevent that, if somebody thinks it is necessary.