Exacct::Object::Group.3perl revision c10c16dec587a0662068f6e2991c29ed3a9db943
te
Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
Exacct::Object::Group 3PERL "1 Dec 2002" "SunOS 5.11" "Perl Library Functions"
NAME
Exacct::Object::Group - exacct group manipulation
SYNOPSIS

use Sun::Solaris::Exacct::Object;
my $ea_grp = Sun::Solaris::Exacct::Object::Group->new(
 & EXT_GROUP | &EXC_DEFAULT | &EXD_GROUP_PROC);
DESCRIPTION

This module is used for manipulating libexacct(3LIB) Group objects. A libexacct Group object is represented as an opaque reference blessed into the Sun::Solaris::Exacct::Object::Group class, which is a subclass of the Sun::Solaris::Exacct::Object class. The Items within a Group are stored inside a Perl array. A reference to the array can be accessed with the inherited value() method. The individual Items within a Group can be manipulated with the normal Perl array syntax and operators. All data elements of the array must be derived from the Sun::Solaris::Exacct::Object class. Group objects can also be nested inside each other simply by adding an existing Group as a data Item.

"Constants"

None.

"Functions"

None.

"Class methods"

Class methods include those inherited from the Sun::Solaris::Exacct::Object base class, plus the following:

new($catalog, @objects)

This method creates and returns a new Sun::Solaris::Exacct::Object::Group. The catalog tag can be either an integer or a Sun::Solaris::Exacct::Catalog. The catalog tag should be a valid catalog tag for a Perl exacct Group object. The @objects parameter is a list of Sun::Solaris::Exacct::Object to be stored inside the Group. A copy of all the passed Items is taken and any Group objects are recursively copied. The contents of the returned Group object can be accessed with the array returned by the value method.

"Object methods"

as_hash()

This method returns the contents of the group as a hash reference. It uses the string value of each item's catalog ID as the hash entry key and the scalar value returned by value() as the hash entry value. This form should be used if there are no duplicate catalog tags in the group. This method and its companion as_hashlist() are the fastest ways to access the contents of a Group.

as_hashlist()

This method returns the contents of the group as a hash reference. It uses the string value of each item's catalog id as the hash entry key and an array of the scalar values returned by value() as the hash entry value for all the items that share a common key. This form should be used if there might be duplicate catalog tags in the group. This method and its companion as_hash() are the fastest ways to access the contents of a Group.

"Exports"

None.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
Interface StabilityEvolving
SEE ALSO

Exacct(3PERL), Exacct::Catalog(3PERL), Exacct::File(3PERL), Exacct::Object(3PERL), Exacct::Object::Item(3PERL), libexacct(3LIB), attributes(5)