Tibco::Rv::Status - status code


Tibco-Rv documentation Contained in the Tibco-Rv distribution.

Index


Code Index:

NAME

Top

Tibco::Rv::Status - status code

SYNOPSIS

Top

   my ( $status ) =
      new Tibco::Rv::Status( status => Tibco::Rv::INVALID_ARG );

   $status = $msg->removeField( $fieldName, $fieldId );
   print "returned: $status\n" if ( $status != Tibco::Rv::OK );




DESCRIPTION

Top

Wrapper class for status codes.

CONSTRUCTOR

Top

$status = new Tibco::Rv::Status( %args )
   %args:
      status => $status

Creates a Tibco::Rv::Status object with the given status. $status should be one of the Tibco::Rv Status Constants, or an equivalent numeric value.

METHODS

Top

$str = $status->toString (or "$status")

Returns a descriptive string of $status. Or, simply use $status in a string context.

$num = $status->toNum (or 0+$status)

Returns the numeric value of $status. Or, simply use $status in a numeric context.

AUTHOR

Top

Paul Sturm <sturm@branewave.com>


Tibco-Rv documentation Contained in the Tibco-Rv distribution.

package Tibco::Rv::Status;


use vars qw/ $VERSION /;
$VERSION = '1.02';


use Inline with => 'Tibco::Rv::Inline';
use Inline C => 'DATA', NAME => __PACKAGE__,
   VERSION => $Tibco::Rv::Inline::VERSION;


use overload '""' => 'toString', '0+' => 'toNum', fallback => 1;


sub new
{
   my ( $proto ) = shift;
   my ( %params ) = ( status => Tibco::Rv::OK );
   my ( %args ) = @_;
   map { Tibco::Rv::die( Tibco::Rv::INVALID_ARG )
      unless ( exists $params{$_} ) } keys %args;
   %params  = ( %params, %args );
   my ( $class ) = ref( $proto ) || $proto;
   my ( $self ) = bless { status => $params{status} }, $class;
   return $self;
}


sub toString { return tibrvStatus_GetText( shift->{status} ) }
sub toNum { return shift->{status} }


1;



__DATA__
__C__


const char * tibrvStatus_GetText( tibrv_status status );