NAME

Persistent::DataType::Base - An Abstract DataType Base Class


SYNOPSIS

  ### we are a subclass of ... ###
  use Persistent::DataType::Base;
  @ISA = qw(Persistent::DataType::Base);


ABSTRACT

This is an abstract base class used by the Persistent framework of classes to implement the attributes of objects. This class provides methods for implementing data types.

This class is not instantiated. Instead, it is inherited from or subclassed by DataType classes.

This class is part of the Persistent base package which is available from:

  http://www.bigsnow.org/persistent
  ftp://ftp.bigsnow.org/pub/persistent


DESCRIPTION

Before we get started describing the methods in detail, it should be noted that all error handling in this class is done with exceptions. So you should wrap an eval block around all of your code. Please see the Persistent documentation for more information on exception handling in Perl.


METHODS


debug -- Accesses the Debugging Flag

  ### set the debugging flag ###
  $object->debug($flag);

  ### get the debugging flag ###
  $flag = $object->debug();

Returns (and optionally sets) the debugging flag of an object. This method does not throw Perl execeptions.

Parameters:

$flag

If set to a true value then debugging is on, otherwise, a false value means off.


Constructor -- Creates a DataType Object

  eval {
    my $datatype = new Persistent::DataType::Object(@args);
  };
  croak "Exception caught: $@" if $@;

Initializes a data type object. This method throws Perl execeptions so use it with an eval block.

This method is abstract and needs implementing.


value -- Accesses the Value of the DataType

  eval {
    ### set the value ###
    $datatype->value($new_value);

    ### get the value ###
    $value = $datatype->value();
  };
  croak "Exception caught: $@" if $@;

Returns (and optionally sets) the value of a DataType object. This method throws Perl execeptions so use it with an eval block.

This method is abstract and needs implementing.


get_compare_op -- Returns the Comparison Operator

  $cmp_op = $obj->get_compare_op();

Returns the comparison operator of a DataType object. This method does not throw Perl execeptions.

This method is abstract and needs implementing.

Can return a couple of different comparison operators:

'cmp'

if the value of the object should be compared as a string.

'<=>'

if the value of the object should be compared as a number.


SEE ALSO

Persistent, Persistent::DataType::Char, Persistent::DataType::DateTime, Persistent::DataType::Number, Persistent::DataType::String, Persistent::DataType::VarChar


BUGS

This software is definitely a work in progress. So if you find any bugs please email them to me with a subject of 'Persistent::DataType Bug' at:

  winters@bigsnow.org

And you know, include the regular stuff, OS, Perl version, snippet of code, etc.


AUTHORS

  David Winters <winters@bigsnow.org>


COPYRIGHT

Copyright (c) 1998-2000 David Winters. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.