"Fossies" - the Fresh Open Source Software Archive

Member "RPerl-5.002000/lib/RPerl/DataStructure/Array_cpp.pm" (30 Aug 2019, 2356 Bytes) of package /linux/misc/RPerl-5.002000.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Array_cpp.pm" see the Fossies "Dox" file reference documentation.

    1 # [[[ HEADER ]]]
    2 package RPerl::DataStructure::Array_cpp;
    3 use strict;
    4 use warnings;
    5 use RPerl::AfterSubclass;
    6 our $VERSION = 0.005_000;
    7 
    8 # [[[ CRITICS ]]]
    9 ## no critic qw(ProhibitStringyEval)  # SYSTEM DEFAULT 1: allow eval()
   10 
   11 # [[[ INCLUDES ]]]
   12 use RPerl::Inline;
   13 
   14 # [[[ SUBROUTINES ]]]
   15 sub cpp_load {
   16     { my void::method $RETURN_TYPE };
   17     my $need_load_cpp = 0;
   18     if (    ( exists $main::{'RPerl__DataStructure__Array__MODE_ID'} )
   19         and ( defined &{ $main::{'RPerl__DataStructure__Array__MODE_ID'} } ) )
   20     {
   21 #        RPerl::diag("in Array_cpp::cpp_load, RPerl__DataStructure__Array__MODE_ID() exists & defined\n");
   22 #        RPerl::diag(q{in Array_cpp::cpp_load, have RPerl__DataStructure__Array__MODE_ID() retval = '} . main::RPerl__DataStructure__Array__MODE_ID() . "'\n");
   23         if ( $RPerl::MODES->{main::RPerl__DataStructure__Array__MODE_ID()}->{ops} ne 'CPP' ) {
   24             $need_load_cpp = 1;
   25         }
   26     }
   27     else {
   28 #        RPerl::diag("in Array_cpp::cpp_load, RPerl__DataStructure__Array__MODE_ID() does not exist or undefined\n");
   29         $need_load_cpp = 1;
   30     }
   31 
   32     if ($need_load_cpp) {
   33 
   34         #        RPerl::diag("in Array_cpp::cpp_load, need load CPP code\n");
   35 
   36         my $eval_string = <<"EOF";
   37 package main;
   38 use RPerl::Inline;
   39 BEGIN { RPerl::diag("[[[ BEGIN 'use Inline' STAGE for 'RPerl/DataStructure/Array.cpp' ]]]\n" x 0); }
   40 use Inline (CPP => '$main::INCLUDE_PATH' . '/RPerl/DataStructure/Array.cpp', \%RPerl::Inline::ARGS);
   41 RPerl::diag("[[[ END   'use Inline' STAGE for 'RPerl/DataStructure/Array.cpp' ]]]\n" x 0);
   42 1;
   43 EOF
   44 
   45         $RPerl::Inline::ARGS{ccflagsex} = $RPerl::Inline::CCFLAGSEX . $RPerl::TYPES_CCFLAG . rperltypessizes::type_integer_native_ccflag() . rperltypessizes::type_number_native_ccflag();
   46         $RPerl::Inline::ARGS{cppflags} = $RPerl::TYPES_CCFLAG . rperltypessizes::type_integer_native_ccflag() . rperltypessizes::type_number_native_ccflag();
   47 #        RPerl::diag("in Array_cpp::cpp_load(), CPP not yet loaded, about to call eval() on \$eval_string =\n<<< BEGIN EVAL STRING>>>\n" . $eval_string . "<<< END EVAL STRING >>>\n");
   48 
   49         eval $eval_string or croak( $OS_ERROR . "\n" . $EVAL_ERROR );
   50         if ($EVAL_ERROR) { croak($EVAL_ERROR); }
   51     }
   52 
   53 #    else { RPerl::diag("in Array_cpp::cpp_load(), CPP already loaded, DOING NOTHING\n"); }
   54     return;
   55 }
   56 
   57 1;  # end of package