DCMTK: OFStandard::OFGroup Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
OFStandard::OFGroup Class Reference

A non-POD version of "struct group" for thread- and memory-safe data access. More...

## Public Member Functions
| OFGroup ()
| default constructor that creates an invalid object.
OFBool | operator! () const
| test if a OFGroup object is invalid.
| operator OFBool () const
| test if a OFGroup object is valid.

## Public Attributes
OFString | gr_name
| the group name.
OFString | gr_passwd
| the group password.
OFVector< OFString > | gr_mem
| usernames of group members.
gid_t | gr_gid
| the group ID.

## Private Member Functions
| OFGroup (group *const g)
| the constructor that "sucks out" a struct group instance.

## Private Attributes
OFBool | ok
| internal state, OFTrue when valid.

## Friends
class | OFStandard
| only OFStandard may instantiate a valid object.

## Detailed Description

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.

Remarks
  This class is only available if DCMTK detected a system offering support for the the <grp.h> header file.

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.

## Constructor & Destructor Documentation

## ◆ OFGroup()

OFStandard::OFGroup::OFGroup | ( | group *const | g | ) |
| private

the constructor that "sucks out" a struct group instance.

Parameters

  g | the struct group instance to clone into this object.

## Member Function Documentation

## ◆ operator OFBool()

OFStandard::OFGroup::operator OFBool | ( |  | ) | const

test if a OFGroup object is valid.

Returns
  OFTrue if the object is valid, otherwise OFFalse.

## ◆ operator!()

OFBool OFStandard::OFGroup::operator! | ( |  | ) | const

test if a OFGroup object is invalid.

Returns
  OFTrue if the object is invalid, otherwise OFFalse.

The documentation for this class was generated from the following file:

- ofstd/include/dcmtk/ofstd/ofgrp.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2