NAME
Net::RRP::Codec - codec class for serialization/deserialization of Net::RRP::Request/Response
SYNOPSIS
use Net::RRP::RRP::Codec;
my $codec = new Net::RRP::Codec();
DESCRIPTION
Net::RRP::Codec - codec class for serialization/deserialization of Net::RRP::Request/Response
new
Constructor of this class.
Example:
use Net::RRP::RRP::Codec;
my $codec = new Net::RRP::Codec();
decodeRequest
This method get the buffer with unparsed rrp request && decode it and return Net::RRP::Request object. The real return object is a instance of Net::RRP::Request::$requestName class. This method dynamic loads required class ( package ). Next, we a parse the Entity part of RRP request and construct the instance of Net::RRP::Entity::$entityName class ( with dynamic loading of this class ) and add entity attributes to this object. After this, parser process the rrp request options and add it's to request object. When all done, method return a constructed rrp request object. This method say throw() at any errors.
Example:
my $request = $codec->decodeRequest ( $buffer );
This method encode the rrp request to buffer for send it's to any stream.
Example:
my $buffer = $codec->encodeRequest ( $request );
decodeResponse
This method constructs the instance of Net::RRP::Response::n$NNN class from input buffer, where the $NNN is a response number ( the Net::RRP::Response::n$NNN loads dynamic ). This method say throw() at any errors;
Example: my $response = $codec->decodeResponse ( $buffer );
encodeResponse
This method get the instance of Net::RRP::Response child class and encodes it's to rrp format.
Example:
my $buffer = $codec->encodeResponse ( $response );
AUTHOR AND COPYRIGHT
Net::RRP::Codec (C) Michael Kulakov, Zenon N.S.P. 2000
125124, 19, 1-st Jamskogo polja st,
Moscow, Russian Federation
mkul@cpan.org
All rights reserved.
You may distribute this package under the terms of either the GNU
General Public License or the Artistic License, as specified in the
Perl README file.
SEE ALSO
Net::RRP::Request(3), Net::RRP::Response(3), Net::RRP::Entity(3), RFC 2832