NAME

Sun::Solaris::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);

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 TYPE        |       ATTRIBUTE VALUE       |
 |_____________________________|_____________________________|
 | Availability                | CPAN (http://www.cpan.org)  |
 |_____________________________|_____________________________|
 | Interface Stability         | Evolving                    |
 |_____________________________|_____________________________|

SEE ALSO

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