📄 plstaf.pm
字号:
} elsif ($type eq "[") { # @SDT/[<number-of-items>:<array-length>:<SDT-Any-1>...<SDT-Any-n> my @theList = (); while (length($data) > 0) { my ($itemLength) = ($data =~ m/[^:]*:([^:]*):.*/so); my $thisItem = substr($data, 0, $+[1] + 1 + $itemLength); $data = substr($data, $+[1] + 1 + $itemLength); push @theList, STAF::STAFUnmarshall($thisItem, $inputContext, %parms)->getPrimaryObject(); } $context->setRootObject(\@theList); } elsif ($type eq "{") { # @SDT/{:<map-length>:<key-1-length>:<key-1><SDT-Any> # ... # :<key-n-length>:<key-1><SDT-Any> my %theMap = (); while (length($data) > 0) { my ($keyLength, $remainder) = ($data =~ m/^:([^:]*):(.*)/so); my $key = substr($remainder, 0, $keyLength); $data = substr($remainder, $keyLength); my ($valueLength) = ($data =~ m/[^:]*:([^:]*):.*/so); my $thisValue = substr($data, 0, $+[1] + 1 + $valueLength); $data = substr($data, $+[1] + 1 + $valueLength); $theMap{$key} = STAF::STAFUnmarshall($thisValue, $inputContext, %parms)->getPrimaryObject(); } $context->setRootObject(\%theMap); } elsif ($type eq "%") { my %theMap = (); #@SDT/%:<map-class-instance-length>::<map-class-name-length>:<map-class-name> # <SDT-Any-value-1> # ... # <SDT-Any-value-n> my ($mcNameLength, $remainder) = ($data =~ m/^:([^:]*):(.*)/so); my $mcName = substr($remainder, 0, $mcNameLength); $data = substr($remainder, $mcNameLength); $theMap{"staf-map-class-name"} = $mcName; if (!$inputContext->hasMapClassDefinition($mcName)) { print "Oops, map class '$mcName' doesn't exist\n"; } my $mapClassDef = $inputContext->getMapClassDefinition($mcName); my @keys = $mapClassDef->keys(); my $keyIndex = 0; while (length($data) > 0) { my ($itemLength) = ($data =~ m/[^:]*:([^:]*):.*/so); my $thisItem = substr($data, 0, $+[1] + 1 + $itemLength); $data = substr($data, $+[1] + 1 + $itemLength); $theMap{$keys[$keyIndex++]{key}} = STAF::STAFUnmarshall($thisItem, $inputContext, %parms)->getPrimaryObject(); } $context->setRootObject(\%theMap); } elsif ($type eq "*") { my ($metaDataLength, $mcData) = ($data =~ m/^\@SDT\/.[^:]*:([^:]*):(.*)/so); my $mcMetaDataContext = STAF::STAFUnmarshall(substr($data, 0, $+[1] + 1 + $metaDataLength), %parms); $context->{mapClassMap} = \%{$mcMetaDataContext->getRootObject()->{"map-class-map"}}; my $mcContent = substr($mcData, $metaDataLength); my $mcContentContext = STAF::STAFUnmarshall($mcContent, $context, %parms); $context->setRootObject($mcContentContext->getRootObject()); } else { $context->setRootObject($input); } return $context;}############################################################################## Note that the return codes are duplicated below in this file so any# changes must be done in both places.# In STAF 3.0.0 Beta 4, as part of the Perl service work, the return codes# were inadvertently renamed with a STAFResult prefix instead of a STAF# prefix. However, this broke existing STAF Perl client code so we added# these back in here.#############################################################################$STAF::kOk = 0;$STAF::kInvalidAPI = 1;$STAF::kUnknownService = 2;$STAF::kInvalidHandle = 3;$STAF::kHandleAlreadyExists = 4;$STAF::kHandleDoesNotExist = 5;$STAF::kUnknownError = 6;$STAF::kInvalidRequestString = 7;$STAF::kInvalidServiceResult = 8;$STAF::kREXXError = 9;$STAF::kBaseOSError = 10;$STAF::kProcessAlreadyComplete = 11;$STAF::kProcessNotComplete = 12;$STAF::kVariableDoesNotExist = 13;$STAF::kUnResolvableString = 14;$STAF::kInvalidResolveString = 15;$STAF::kNoPathToMachine = 16;$STAF::kFileOpenError = 17;$STAF::kFileReadError = 18;$STAF::kFileWriteError = 19;$STAF::kFileDeleteError = 20;$STAF::kSTAFNotRunning = 21;$STAF::kCommunicationError = 22;$STAF::kTrusteeDoesNotExist = 23;$STAF::kInvalidTrustLevel = 24;$STAF::kAccessDenied = 25;$STAF::kSTAFRegistrationError = 26;$STAF::kServiceConfigurationError = 27;$STAF::kQueueFull = 28;$STAF::kNoQueueElement = 29;$STAF::kNotifieeDoesNotExist = 30;$STAF::kInvalidAPILevel = 31;$STAF::kServiceNotUnregisterable = 32;$STAF::kServiceNotAvailable = 33;$STAF::kSemaphoreDoesNotExist = 34;$STAF::kNotSemaphoreOwner = 35;$STAF::kSemaphoreHasPendingRequests = 36;$STAF::kTimeout = 37;$STAF::kJavaError = 38;$STAF::kConverterError = 39;$STAF::kServiceAlreadyExists = 40;$STAF::kInvalidObject = 41;$STAF::kInvalidParm = 42;$STAF::kRequestNumberNotFound = 43;$STAF::kInvalidAsynchOption = 44;$STAF::kRequestNotComplete = 45;$STAF::kProcessAuthenticationDenied = 46;$STAF::kInvalidValue = 47;$STAF::kDoesNotExist = 48;$STAF::kAlreadyExists = 49;$STAF::kDirectoryNotEmpty = 50;$STAF::kDirectoryCopyError = 51;$STAF::kDiagnosticsNotEnabled = 52;$STAF::kHandleAuthenticationDenied = 53;$STAF::kHandleAlreadyAuthenticated = 54;$STAF::kInvalidSTAFVersion = 55;$STAF::kRequestCancelled = 56;$STAF::kUserDefined = 4000;################################################################################# Define the submit2 sync mode options################################################################################$STAF::STAFHandle::kReqSync = 0;$STAF::STAFHandle::kReqFireAndForget = 1;$STAF::STAFHandle::kReqQueue = 2;$STAF::STAFHandle::kReqRetain = 3;$STAF::STAFHandle::kReqQueueRetain = 4;############################################################################## Note that the return codes are duplicated above in this file so any# changes must be done in both places.# In STAF 3.0.0 Beta 4, as part of the Perl service work, the return codes# were inadvertently renamed with a STAFResult prefix instead of a STAF # prefix. However, this broke existing STAF Perl client code so we added# them back in above.#############################################################################package STAFResult;use constant kOk => scalar 0;use constant kInvalidAPI => scalar 1;use constant kUnknownService => scalar 2;use constant kInvalidHandle => scalar 3;use constant kHandleAlreadyExists => scalar 4;use constant kHandleDoesNotExist => scalar 5;use constant kUnknownError => scalar 6;use constant kInvalidRequestString => scalar 7;use constant kInvalidServiceResult => scalar 8;use constant kREXXError => scalar 9;use constant kBaseOSError => scalar 10;use constant kProcessAlreadyComplete => scalar 11;use constant kProcessNotComplete => scalar 12;use constant kVariableDoesNotExist => scalar 13;use constant kUnResolvableString => scalar 14;use constant kInvalidResolveString => scalar 15;use constant kNoPathToMachine => scalar 16;use constant kFileOpenError => scalar 17;use constant kFileReadError => scalar 18;use constant kFileWriteError => scalar 19;use constant kFileDeleteError => scalar 20;use constant kSTAFNotRunning => scalar 21;use constant kCommunicationError => scalar 22;use constant kTrusteeDoesNotExist => scalar 23;use constant kInvalidTrustLevel => scalar 24;use constant kAccessDenied => scalar 25;use constant kSTAFRegistrationError => scalar 26;use constant kServiceConfigurationError => scalar 27;use constant kQueueFull => scalar 28;use constant kNoQueueElement => scalar 29;use constant kNotifieeDoesNotExist => scalar 30;use constant kInvalidAPILevel => scalar 31;use constant kServiceNotUnregisterable => scalar 32;use constant kServiceNotAvailable => scalar 33;use constant kSemaphoreDoesNotExist => scalar 34;use constant kNotSemaphoreOwner => scalar 35;use constant kSemaphoreHasPendingRequests => scalar 36;use constant kTimeout => scalar 37;use constant kJavaError => scalar 38;use constant kConverterError => scalar 39;use constant kServiceAlreadyExists => scalar 40;use constant kInvalidObject => scalar 41;use constant kInvalidParm => scalar 42;use constant kRequestNumberNotFound => scalar 43;use constant kInvalidAsynchOption => scalar 44;use constant kRequestNotComplete => scalar 45;use constant kProcessAuthenticationDenied => scalar 46;use constant kInvalidValue => scalar 47;use constant kDoesNotExist => scalar 48;use constant kAlreadyExists => scalar 49;use constant kDirectoryNotEmpty => scalar 50;use constant kDirectoryCopyError => scalar 51;use constant kDiagnosticsNotEnabled => scalar 52;use constant kHandleAuthenticationDenied => scalar 53;use constant kHandleAlreadyAuthenticated => scalar 54;use constant kInvalidSTAFVersion => scalar 55;use constant kRequestCancelled => scalar 56;use constant kUserDefined => scalar 4000;################################################################################ Autoload methods go after =cut, and are processed by the autosplit program.1;__END__# Below is stub documentation for your module. You'd better edit it!=head1 NAMEPLSTAF - Perl extension for blah blah blah=head1 SYNOPSIS use PLSTAF; blah blah blah=head1 ABSTRACT This should be the abstract for PLSTAF. The abstract is used when making PPD (Perl Package Description) files. If you don't want an ABSTRACT you should also edit Makefile.PL to remove the ABSTRACT_FROM option.=head1 DESCRIPTIONStub documentation for PLSTAF, created by h2xs. It looks like theauthor of the extension was negligent enough to leave the stubunedited.Blah blah blah.=head2 EXPORTNone by default.=head1 SEE ALSOMention other useful documentation such as the documentation ofrelated modules or operating system documentation (such as man pagesin UNIX), or any relevant external documentation such as RFCs orstandards.If you have a mailing list set up for your module, mention it here.If you have a web site set up for your module, mention it here.=head1 AUTHORA. U. Thor, E<lt>a.u.thor@a.galaxy.far.far.awayE<gt>=head1 COPYRIGHT AND LICENSECopyright 2002 by A. U. ThorThis library is free software; you can redistribute it and/or modifyit under the same terms as Perl itself. =cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -