| GSM-SMS documentation | Contained in the GSM-SMS distribution. |
GSM::SMS::TransportRouter::TransportRouter - Abstract router class
An abstract TransportRouter base class. All concrete transport routers must inherit from this class.
$route = $tr->route( $msisdn, @transport_list ); Return 'undef' when no route found. ABSTRACT METHOD - needs to be implemented.
When an explicit transport has been given to the constructor, we'll only try to route through this transport. This method can be used to get the name of that specific transport.
Johan Van den Brande <johan@vandenbrande.com>
| GSM-SMS documentation | Contained in the GSM-SMS distribution. |
package GSM::SMS::TransportRouter::TransportRouter; use strict; use vars qw( $VERSION );
use Log::Agent;
sub new { my ( $proto, %arg ) = @_; my $class = ref($proto) || $proto; logdbg "debug", "$class constructor called"; bless { _transport => $arg{-transport} }, ref($proto) || $proto; }
sub route { my ($self) = @_; my $object_class = ref($self); my ($file, $line, $method) = (caller(1))[1..3]; die "Call to abstract method ${method} at $file, line $line\n"; }
sub get_transport { return $_[0]->{_transport}; }
1; __END__