1 # 2 # Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. 3 # 4 5 # 6 # Sun::Solaris::Exacct::Object::Group documentation. 7 # 8 9 =head1 NAME 10 11 Sun::Solaris::Exacct::Object::Group - exacct group manipulation 12 13 =head1 SYNOPSIS 14 15 use Sun::Solaris::Exacct::Object; 16 my $ea_grp = Sun::Solaris::Exacct::Object::Group->new( 17 &EXT_GROUP | &EXC_DEFAULT | &EXD_GROUP_PROC); 18 19 This module is used for manipulating C<libexacct(3LIB)> Group objects. A 20 libexacct Group object is represented as an opaque reference blessed into the 21 C<Sun::Solaris::Exacct::Object::Group> class, which is a subclass of the 22 C<Sun::Solaris::Exacct::Object> class. The Items within a Group are stored 23 inside a Perl array. A reference to the array can be accessed with the 24 inherited value() method. The individual Items within a Group can be 25 manipulated with the normal Perl array syntax and operators. All data elements 26 of the array must be derived from the C<Sun::Solaris::Exacct::Object> class. 27 Group objects can also be nested inside each other simply by adding an 28 existing Group as a data Item. 29 30 =head2 Constants 31 32 None. 33 34 =head2 Functions 35 36 None. 37 38 =head2 Class methods 39 40 Class methods include those inherited from the C<Sun::Solaris::Exacct::Object> 41 base class, plus the following: 42 43 B<C<new($catalog, @objects)>> 44 45 This method creates and returns a new C<Sun::Solaris::Exacct::Object::Group>. 46 The catalog tag can be either an integer or a 47 C<Sun::Solaris::Exacct::Catalog>. The catalog tag should be a valid catalog 48 tag for a Perl exacct Group object. The C<@objects> parameter is a list of 49 C<Sun::Solaris::Exacct::Object> to be stored inside the Group. A copy of all 50 the passed Items is taken and any Group objects are recursively copied. The 51 contents of the returned Group object can be accessed with the array returned 52 by the C<value()> method. 53 54 =head2 Object methods 55 56 B<C<as_hash()>> 57 58 This method returns the contents of the group as a hash reference. It uses the 59 string value of each item's catalog ID as the hash entry key and the scalar 60 value returned by C<value()> as the hash entry value. 61 62 This form should be used if there are no duplicate catalog tags in the group. 63 64 This method and its companion C<as_hashlist()> are the fastest ways to access 65 the contents of a Group. 66 67 B<C<as_hashlist()>> 68 69 This method returns the contents of the group as a hash reference. It uses the 70 string value of each item's catalog id as the hash entry key and an array of 71 the scalar values returned by C<value()> as the hash entry value for all the 72 items that share a common key. This form should be used if there might be 73 duplicate catalog tags in the group. 74 75 This method and its companion C<as_hash()> are the fastest ways to access the 76 contents of a Group. 77 78 =head2 Exports 79 80 None. 81 82 =head1 ATTRIBUTES 83 84 See C<attributes(5)> for descriptions of the following attributes: 85 86 ___________________________________________________________ 87 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 88 |_____________________________|_____________________________| 89 | Availability | CPAN (http://www.cpan.org) | 90 |_____________________________|_____________________________| 91 | Interface Stability | Evolving | 92 |_____________________________|_____________________________| 93 94 =head1 SEE ALSO 95 96 C<Sun::Solaris::Exacct(3)>, C<Sun::Solaris::Exacct::Catalog(3)>, 97 C<Sun::Solaris::Exacct::File(3)>, C<Sun::Solaris::Exacct::Object(3)>, 98 C<Sun::Solaris::Exacct::Object::Item(3)>, C<libexacct(3LIB)>, C<attributes(5)>