| UMMF documentation | Contained in the UMMF distribution. |
__validate_type__typecheckisaNamespaceisaModel__Namespace__model_name __isAbstract__tangram_schema___initialize__initialize__createcontainedElementindex_containedElementindex_of_containedElementset_containedElementset_index_containedElementadd_containedElementadd_index_containedElementremove_containedElementclear_containedElementcount_containedElementimporterset_importeradd_importerremove_importerclear_importercount_importer
UMMF::MOF_1_3::Model::Namespace --
1.3
NO ATTRIBUTES
container : THIS 0..1 <---> containedElement : UMMF::MOF_1_3::Model::ModelElement 0..*0..*changeableinstanceorderednonepublicARRAYimported : THIS 1 <---> importer : UMMF::MOF_1_3::Model::Import 0..*0..*changeableinstancenonepublicSet::Object__validate_typeUMMF::MOF_1_3::Model::Namespace->__validate_type($value);
Returns true if $value is a valid representation of UMMF::MOF_1_3::Model::Namespace.
__typecheckUMMF::MOF_1_3::Model::Namespace->__typecheck($value, $msg);
Calls confess() with $msg if <UMMF::MOF_1_3::Model::Namespace-__validate_type($value)>> is false.
isaNamespaceReturns true if receiver is a UMMF::MOF_1_3::Model::Namespace. Other receivers will return false.
isaModel__NamespaceReturns true if receiver is a UMMF::MOF_1_3::Model::Namespace.
Other receivers will return false.
This is the fully qualified version of the isaNamespace method.
__model_name my $name = $obj_or_package->__model_name;
Returns the UML Model name ('Model::Namespace') for an object or package of
this Classifier.
__isAbstract$package->__isAbstract;
Returns 1.
__tangram_schemamy $tangram_schema $obj_or_package->__tangram_schema
Returns a HASH ref that describes this Classifier for Tangram.
___initializeInitialize all Attributes and AssociationEnds in a instance of this Classifier. Does not initalize slots in its Generalizations.
See also: __initialize.
__initializeInitialize all slots in this Classifier and all its Generalizations.
See also: ___initialize.
__createCalls all <<create>> Methods for this Classifier and all Generalizations.
See also: ___create.
containedElementmy @val = $obj->containedElement; my $ary_val = $obj->containedElement;
Returns the AssociationEnd containedElement values of type UMMF::MOF_1_3::Model::ModelElement.
In array context, returns all the objects in the Association.
In scalar context, returns an array ref of all the objects in the Association.
index_containedElementmy $x = $obj->index_containedElement($i); my @x = $obj->index_containedElement($i, $count);
In scalar context, returns the value of AssociationEnd containedElement at index $i.
In array context, returns the values between index $i and $i + $count - 1, inclusive.
index_of_containedElementmy $index = $obj->index_of_containedElement($val);
Returns the index of $val in AssociationEnd containedElement.
Return undef if $val is not in containedElement.
set_containedElement$obj->set_containedElement(@val);
Sets the AssociationEnd containedElement value.
Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement.
Returns $obj.
set_index_containedElement$obj->set_index_containedElement($i, $val);
Sets the value of AssociationEnd containedElement at index $i.
Returns self.
add_containedElement$obj->add_containedElement(@val);
Adds AssociationEnd containedElement values.
Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement.
Returns $obj.
add_index_containedElement$obj->add_index_containedElement($i, @val);
Adds AssociationEnd containedElement values at index $i.
Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement.
Returns $obj.
remove_containedElement$obj->remove_containedElement(@val);
Removes the AssociationEnd containedElement values @val.
Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement.
Returns $obj.
clear_containedElement$obj->clear_containedElement;
Clears the AssociationEnd containedElement links to UMMF::MOF_1_3::Model::ModelElement.
Returns $obj.
count_containedElement$obj->count_containedElement;
Returns the number of elements associated with containedElement.
importermy @val = $obj->importer; my $ary_val = $obj->importer;
Returns the AssociationEnd importer values of type UMMF::MOF_1_3::Model::Import.
In array context, returns all the objects in the Association.
In scalar context, returns an array ref of all the objects in the Association.
set_importer$obj->set_importer(@val);
Sets the AssociationEnd importer value.
Elements of @val must of type UMMF::MOF_1_3::Model::Import.
Returns $obj.
add_importer$obj->add_importer(@val);
Adds AssociationEnd importer values.
Elements of @val must of type UMMF::MOF_1_3::Model::Import.
Returns $obj.
remove_importer$obj->remove_importer(@val);
Removes the AssociationEnd importer values @val.
Elements of @val must of type UMMF::MOF_1_3::Model::Import.
Returns $obj.
clear_importer$obj->clear_importer;
Clears the AssociationEnd importer links to UMMF::MOF_1_3::Model::Import.
Returns $obj.
count_importer$obj->count_importer;
Returns the number of elements associated with importer.
END OF DOCUMENT
| UMMF documentation | Contained in the UMMF distribution. |
# -*- perl -*- # DO NOT EDIT - This file is generated by UMMF; http://ummf.sourceforge.net # From template: $Id: Perl.txt,v 1.77 2006/05/14 01:40:03 kstephens Exp $ package UMMF::MOF_1_3::Model::Namespace; #use 5.6.1; use strict; use warnings; ################################################################# # Version # our $VERSION = do { my @r = (q{1.3} =~ /\d+/g); sprintf "%d." . "%03d" x $#r, @r }; ################################################################# # Documentation #
################################################################# # Dependencies # use Carp qw(croak confess); use Set::Object 1.05; use Class::Multimethods 1.70; use Data::Dumper; use Scalar::Util qw(weaken); use UMMF::MOF_1_3::__ObjectBase qw(:__ummf_array); ################################################################# # Generalizations # use base qw( UMMF::MOF_1_3::Model::ModelElement ); ################################################################# # Exports # our @EXPORT_OK = qw( ); our %EXPORT_TAGS = ( 'all' => \@EXPORT_OK ); ################################################################# # Validation #
sub __validate_type($$) { my ($self, $x) = @_; no warnings; UNIVERSAL::isa($x, 'UMMF::MOF_1_3::Model::Namespace') ; }
sub __typecheck { my ($self, $x, $msg) = @_; confess("typecheck: $msg: type '" . 'UMMF::MOF_1_3::Model::Namespace' . ": value '$x'") unless __validate_type($self, $x); }
sub isaNamespace { 1 }
sub isaModel__Namespace { 1 } ################################################################# # Introspection #
sub __model_name { 'Model::Namespace' }
sub __isAbstract { 1; } my $__tangram_schema;
sub __tangram_schema { my ($self) = @_; $__tangram_schema ||= { 'classes' => [ 'UMMF::MOF_1_3::Model::Namespace' => { 'table' => 'Model__Namespace', 'abstract' => 1, 'slots' => { # Attributes # Associations 'containedElement' => { 'type_impl' => 'iarray', 'class' => 'UMMF::MOF_1_3::Model::ModelElement', 'table' => 'Model__Namespace__containedElement', 'coll' => 'container', 'slot' => 'container_i', 'aggreg' => '1', } , 'importer' => { 'type_impl' => 'iset', 'class' => 'UMMF::MOF_1_3::Model::Import', 'table' => 'Model__Namespace__importer', 'coll' => 'imported', } , }, 'bases' => [ 'UMMF::MOF_1_3::Model::ModelElement', ], 'sql' => { }, }, ], 'sql' => { # Note Tangram::Ref::get_exporter() has # "UPDATE $table SET $self->{col} = $refid WHERE id = $id", # The id_col is hard-coded, # Thus id_col will not work. #'id_col' => '__sid', #'class_col' => '__stype', }, # 'set_id' => sub { } # 'get_id' => sub { } }; } ################################################################# # Class Attributes # ################################################################# # Class Associations # ################################################################# # Initialization #
sub ___initialize { my ($self) = @_; # Attributes # Associations # AssociationEnd # container 0..1 # <--> # containedElement 0..* UMMF::MOF_1_3::Model::ModelElement. if ( defined $self->{'containedElement'} ) { my $x = $self->{'containedElement'}; $self->{'containedElement'} = [ ]; $self->set_containedElement(@$x); } # AssociationEnd # imported 1 # <--> # importer 0..* UMMF::MOF_1_3::Model::Import. if ( defined $self->{'importer'} ) { my $x = $self->{'importer'}; $self->{'importer'} = Set::Object->new(); $self->set_importer(@$x); } $self; } my $__initialize_use;
sub __initialize { my ($self) = @_; # $DB::single = 1; unless ( ! $__initialize_use ) { $__initialize_use = 1; $self->__use('UMMF::MOF_1_3::Model::ModelElement'); } $self->UMMF::MOF_1_3::Model::Namespace::___initialize; $self->UMMF::MOF_1_3::Model::ModelElement::___initialize; $self; }
sub __create { my ($self, @args) = @_; # $DB::single = 1; $self->UMMF::MOF_1_3::Model::Namespace::___create(@args); $self->UMMF::MOF_1_3::Model::ModelElement::___create(); $self; } ################################################################# # Attributes # ################################################################# # Association #
################################################################# # AssociationEnd container <---> containedElement # type = UMMF::MOF_1_3::Model::ModelElement # multiplicity = 0..* # ordering = ordered
sub containedElement ($) { my ($self) = @_; my $x = $self->{'containedElement'} ||= [ ]; wantarray ? @{$x} : $x; }
sub index_containedElement ($$@) { my ($self, $i, $count) = @_; ; my $val = $self->{'containedElement'} ||= [ ]; ; wantarray ? $val->[$i .. (defined $count ? $i + $count - 1 : $i)] : $val->[$i]; }
sub index_of_containedElement ($$) { my ($self, $x) = @_; ; my $val = $self->{'containedElement'} ||= [ ]; ; __ummf_array_index($val, $x); }
sub set_containedElement ($@) { my ($self, @val) = @_; $self->clear_containedElement; $self->add_containedElement(@val); }
sub set_index_containedElement ($$$) { my ($self, $i, $val) = @_; ; my $x = $self->{'containedElement'} ||= [ ]; no warnings; my $old; if ( ($old = $x->[$i]) ne $val) { # Recursion lock $x->[$i] = $val ; # Remove and add associations with other ends. $old->remove_container($self) if $old; $val->add_container($self) if $val; ; } $self; }
sub add_containedElement ($@) { my ($self, @val) = @_; my $x = $self->{'containedElement'} ||= [ ]; my $old; # Place holder for other MACRO. for my $val ( @val ) { # Recursion lock next if grep($_ eq $val, @$x); $self->__use('UMMF::MOF_1_3::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_3::Model::Namespace.containedElement"); # Recursion lock push(@{$x}, $val); # Remove and add associations with other ends. $old->remove_container($self) if $old; $val->add_container($self) if $val; } $self; }
sub add_index_containedElement ($$@) { my ($self, $i, @val) = @_; my $x = $self->{'containedElement'} ||= [ ]; my $old; # Place holder for other MACRO. for my $val ( @val ) { # Recursion lock next if grep($_ eq $val, @$x); $self->__use('UMMF::MOF_1_3::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_3::Model::Namespace.containedElement"); # Recursion lock splice(@{$x}, $i, 0, $val); # Recursion lock ++ $i; # Remove and add associations with other ends. $old->remove_container($self) if $old; $val->add_container($self) if $val; } $self; }
sub remove_containedElement ($@) { my ($self, @val) = @_; my $x = $self->{'containedElement'} ||= [ ]; for my $old ( @val ) { # Recursion lock my $i; # index of $old in @$x. next unless defined($i = __ummf_array_index($x, $old)); my $val = $old; $self->__use('UMMF::MOF_1_3::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_3::Model::Namespace.containedElement"); # Recursion lock splice(@$x, $i, 1); $val = undef; # Remove associations with other ends. $old->remove_container($self) if $old; $val->add_container($self) if $val; ; } $self; }
sub clear_containedElement ($) { my ($self) = @_; my $x = $self->{'containedElement'} ||= [ ]; my $val; # Place holder for other MACRO. $self->{'containedElement'} = [ ]; # Recursion lock for my $old ( @$x ) { # Recursion lock # Remove associations with other ends. $old->remove_container($self) if $old; $val->add_container($self) if $val; ; } $self; }
sub count_containedElement ($) { my ($self) = @_; my $x = $self->{'containedElement'}; defined $x ? scalar @$x : 0; }
################################################################# # AssociationEnd imported <---> importer # type = UMMF::MOF_1_3::Model::Import # multiplicity = 0..* # ordering =
sub importer ($) { my ($self) = @_; my $x = $self->{'importer'}; # confess("Container for importer $x is not a blessed ref: " . Data::Dumper->new([ $self ], [qw($self)])->Maxdepth(2)->Dump()) if $x && ref($x) !~ /::/; wantarray ? ($x ? $x->members() : ()) : [ $x ? $x->members() : () ]; }
sub set_importer ($@) { my ($self, @val) = @_; $self->clear_importer; $self->add_importer(@val); }
sub add_importer ($@) { my ($self, @val) = @_; my $x = $self->{'importer'} ||= Set::Object->new(); my $old; # Place holder for other MACRO. for my $val ( @val ) { # Recursion lock next if $x->includes($val); $self->__use('UMMF::MOF_1_3::Model::Import')->__typecheck($val, "UMMF::MOF_1_3::Model::Namespace.importer"); # Recursion lock $x->insert($val); # weaken? # Remove and add associations with other ends. $old->remove_imported($self) if $old; $val->add_imported($self) if $val; } $self; }
sub remove_importer ($@) { my ($self, @val) = @_; my $x = $self->{'importer'} ||= Set::Object->new(); for my $old ( @val ) { # Recursion lock next unless $x->includes($old); my $val = $old; $self->__use('UMMF::MOF_1_3::Model::Import')->__typecheck($val, "UMMF::MOF_1_3::Model::Namespace.importer"); # Recursion lock $x->remove($old); $val = undef; # Remove associations with other ends. $old->remove_imported($self) if $old; $val->add_imported($self) if $val; ; } $self; }
sub clear_importer ($) { my ($self) = @_; my $x = $self->{'importer'} ||= Set::Object->new(); my $val; # Place holder for other MACRO. $self->{'importer'} = Set::Object->new(); # Recursion lock for my $old ( $x->members() ) { # Recursion lock # Remove associations with other ends. $old->remove_imported($self) if $old; $val->add_imported($self) if $val; ; } $self; }
sub count_importer ($) { my ($self) = @_; my $x = $self->{'importer'}; defined $x ? $x->size : 0; } # End of Class Namespace
############################################################################ 1; # is true! ############################################################################ ### Keep these comments at end of file: kstephens@users.sourceforge.net 2003/04/06 ### ### Local Variables: ### ### mode:perl ### ### perl-indent-level:2 ### ### perl-continued-statement-offset:0 ### ### perl-brace-offset:0 ### ### perl-label-offset:0 ### ### End: ###