package XXV::OUTPUT::Dump;

use strict;

use vars qw($AUTOLOAD);
use Data::Dumper;
use Tools;

# ------------------
sub AUTOLOAD {
# ------------------
    my $obj = shift || return error ('No Object!' );
    $Data::Dumper::Maxdepth = 0;

    return if($AUTOLOAD =~ /DESTROY$/);
    my $out = Dumper( [$AUTOLOAD, @_] );

    $obj->{handle}->print("STT\n");
    $obj->{handle}->print($out);
    $obj->{handle}->print("EOF\n");
}

# ------------------
sub new {
# ------------------
	my($class, %attr) = @_;
	my $self = {};
	bless($self, $class);

    $self->{handle} = $attr{'-handle'}
        || return error('No handle defined!');

    $self->{TYP} = 'INTERFACE';

	return $self;
}

# ------------------
sub typ {
# ------------------
    my $obj = shift || return error ('No Object!' );
    return $obj->{TYP};
}

1;