File: Type.pm

package info (click to toggle)
libtangram-perl 2.10-1.1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 1,064 kB
  • ctags: 703
  • sloc: perl: 9,665; makefile: 35
file content (93 lines) | stat: -rw-r--r-- 1,021 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package Tangram::Type;

use strict;
use Carp;

my %instances;

sub instance
{
	my $pkg = shift;
	return $instances{$pkg} ||= bless { }, $pkg;
}

sub new {
    my $inv = shift;
    return $inv->instance(@_);
}

sub reschema
{
}

sub members
{
   my ($self, $members) = @_;
   keys %$members;
}

sub query_expr
{
}

sub remote_expr
{
}

sub erase
{
}

sub read_data
{
	my ($self, $row) = @_;
	shift @$row;
}

sub read
{
   my ($self, $row, $obj, $members) = @_;
	
	foreach my $key (keys %$members)
	{
		$obj->{$key} = $self->read_data($row)
	}
}

sub prefetch
{
}

sub expr
{
	return Tangram::Expr->new( @_ );
}

sub get_exporters
  {
	my ($self, $fields, $context) = @_;
	return map { $fields->{$_}->get_exporter($context) } keys %$fields;
  }

sub get_importer
  {
	my $type = ref shift();
	die "$type does not implement new get_importer method";
  }

sub get_exporter
  {
	my $type = ref shift();
	die "$type does not implement new get_exporter method";
  }

sub get_export_cols
  {
	()
  }

sub get_intrusions {
}


1;