Exacct::Object::Group(3PERL) Perl Library Functions Exacct::Object::Group(3PERL)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 TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWpl5u |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO Exacct(3PERL), Exacct::Catalog(3PERL), Exacct::File(3PERL), Exacct::Object(3PERL), Exacct::Object::Item(3PERL), libexacct(3LIB),
attributes(5)SunOS 5.10 1 Dec 2002 Exacct::Object::Group(3PERL)
Check Out this Related Man Page
Exacct::Catalog(3PERL) Perl Library Functions Exacct::Catalog(3PERL)NAME
Exacct::Catalog - exacct catalog tag manipulation
SYNOPSIS
use Sun::Solaris::Exacct::Catalog qw(:ALL);
my $ea_cat = Sun::Solaris::Exacct::Catalog->new(
&EXT_UINT64 | &EXC_DEFAULT | &EXD_PROC_PID);
DESCRIPTION
This class provides a wrapper around the 32-bit integer used as a catalog tag. The catalog tag is represented as a Perl object blessed
into the Sun::Solaris::Exacct::Catalog class so that methods can be used to manipulate fields in a catalog tag.
Constants
All the EXT_*, EXC_*, and EXD_* macros are provided as constants. Constants passed to the methods below can either be the integer value
such as EXT_UINT8 or the string representation such as "EXT_UINT8".
Functions
None.
Class methods
register($cat_pfx, $catalog_id, $export, @idlist)
This method is used to register application-defined libexacct(3LIB) catalogs with the exacct Perl library. See
</usr/include/sys/exacct_catalog.h> for details of the catalog tag format. This method allows symbolic names and strings to be used
for manipulating application-defined catalogs. The first two parameters define the catalog prefix and associated numeric catalog ID. If
the $export parameter is true, the constants are exported into the caller's package. The final parameter is a list of (id, name) pairs
that identify the required constants. The constants created by this method are formed by appending $cat_pfx and "_" to each name in the
list, replacing any spaces with underscore characters and converting the resulting string to uppercase characters. The $catalog_name
value is also created as a constant by prefixing it with EXC_ and converting it to uppercase characters. Its value becomes that of
$catalog_id shifted left by 24 bits. For example, the following call:
Sun::Solaris::Exacct::Catalog->ea_register("MYCAT", 0x01, 1,
FIRST => 0x00000001, SECOND => 0x00000010);
results in the definition of the following constants:
EXC_MYCAT 0x01 << 24
MYCAT_FIRST 0x00000001
MYCAT_SECOND 0x00000010
Only the catalog ID value of 0x01 is available for application use (EXC_LOCAL). All other values are reserved. While it is possible to
use values other than 0x01, they might conflict with future extensions to the libexacct file format.
If any errors are detected during this method, a string is returned containing the appropriate error message. If the call is sucessful,
undef is returned.
new($integer)
new($cat_obj)
new($type, $catalog, $id)
This method creates and returns a new Catalog object, which is a wrapper around a 32-bit integer catalog tag. Three possible argument
lists can be given. The first variant is to pass an integer formed by bitwise-inclusive OR of the appropriate EX[TCD]_* constants. The
second variant is to pass an existing Catalog object that will be copied. The final variant is to pass in the type, catalog and ID
fields as separate values. Each of these values can be either an appropriate integer constant or the string representation of the con-
stant.
Object methods
value()
This method allows the value of the catalog tag to be queried. In a scalar context it returns the 32-bit integer representing the tag.
In a list context it returns a (type, catalog, id) triplet, where each member of the triplet is a dual-typed scalar.
type()
This method returns the type field of the catalog tag as a dual-typed scalar.
catalog()
This method returns the catalog field of the catalog tag as a dual-typed scalar.
id()
This method returns the id field of the catalog tag as a dual-typed scalar.
type_str()
catalog_str()
id_str()
These methods return string representations of the appropriate value. These methods can be used for textual output of the various cata-
log fields. The string representations of the constants are formed by removing the EXT_, EXC_, or EXD_ prefix, replacing any under-
score characters with spaces, and converting the remaining string to lowercase characters.
Exports
By default nothing is exported from this module. The following tags can be used to selectively import constants and functions defined in
this module:
:CONSTANTS EXT_*, EXC_*, and EXD_*
:ALL :CONSTANTS
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWpl5u |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO Exacct(3PERL), Exacct::File(3PERL), Exacct::Object(3PERL), Exacct::Object::Group(3PERL), Exacct::Object::Item(3PERL), libexacct(3LIB),
attributes(5)SunOS 5.10 1 Dec 2002 Exacct::Catalog(3PERL)