You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/02/20 03:43:23 UTC
[lucy-commits] svn commit: r1072479 - in /incubator/lucy/trunk/clownfish: lib/Clownfish.pm
lib/Clownfish/Base.pm src/CFCBase.c src/CFCBase.h typemap
Author: marvin
Date: Sun Feb 20 02:43:22 2011
New Revision: 1072479
URL: http://svn.apache.org/viewvc?rev=1072479&view=rev
Log:
Make Clownfish::Base accessible from Perl-space and add some class
introspection capabilities for CFC objects.
Added:
incubator/lucy/trunk/clownfish/lib/Clownfish/Base.pm
Modified:
incubator/lucy/trunk/clownfish/lib/Clownfish.pm
incubator/lucy/trunk/clownfish/src/CFCBase.c
incubator/lucy/trunk/clownfish/src/CFCBase.h
incubator/lucy/trunk/clownfish/typemap
Modified: incubator/lucy/trunk/clownfish/lib/Clownfish.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish.pm?rev=1072479&r1=1072478&r2=1072479&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish.pm (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish.pm Sun Feb 20 02:43:22 2011
@@ -17,8 +17,18 @@ use strict;
use warnings;
package Clownfish;
+use Clownfish::Base;
our $VERSION = '0.01';
+BEGIN {
+ push @Clownfish::CBlock::ISA, "Clownfish::Base";
+ push @Clownfish::DocuComment::ISA, "Clownfish::Base";
+ push @Clownfish::File::ISA, "Clownfish::Base";
+ push @Clownfish::Parcel::ISA, "Clownfish::Base";
+ push @Clownfish::Symbol::ISA, "Clownfish::Base";
+ push @Clownfish::Type::ISA, "Clownfish::Base";
+}
+
use XSLoader;
BEGIN { XSLoader::load( 'Clownfish', '0.01' ) }
Added: incubator/lucy/trunk/clownfish/lib/Clownfish/Base.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish/Base.pm?rev=1072479&view=auto
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish/Base.pm (added)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish/Base.pm Sun Feb 20 02:43:22 2011
@@ -0,0 +1,37 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+use strict;
+use warnings;
+
+package Clownfish::Base;
+use Clownfish;
+
+1;
+
+__END__
+
+__POD__
+
+=head1 NAME
+
+Clownfish::Base - Base class for all CFC objects.
+
+=head1 DESCRIPTION
+
+ # TODO
+
+=cut
+
Modified: incubator/lucy/trunk/clownfish/src/CFCBase.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCBase.c?rev=1072479&r1=1072478&r2=1072479&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCBase.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCBase.c Sun Feb 20 02:43:22 2011
@@ -68,3 +68,10 @@ CFCBase_get_perl_obj(CFCBase *self)
return self->perl_obj;
}
+const char*
+CFCBase_get_cfc_class(CFCBase *self)
+{
+ return HvNAME(SvSTASH((SV*)self->perl_obj));
+}
+
+
Modified: incubator/lucy/trunk/clownfish/src/CFCBase.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCBase.h?rev=1072479&r1=1072478&r2=1072479&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCBase.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCBase.h Sun Feb 20 02:43:22 2011
@@ -58,5 +58,11 @@ CFCBase_decref(CFCBase *self);
void*
CFCBase_get_perl_obj(CFCBase *self);
+/** Return the class name of the CFC object. (Not the class name of any
+ * parsed object the CFC object might represent.)
+ */
+const char*
+CFCBase_get_cfc_class(CFCBase *self);
+
#endif /* H_CFCBASE */
Modified: incubator/lucy/trunk/clownfish/typemap
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/typemap?rev=1072479&r1=1072478&r2=1072479&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/typemap (original)
+++ incubator/lucy/trunk/clownfish/typemap Sun Feb 20 02:43:22 2011
@@ -14,6 +14,7 @@
# limitations under the License.
TYPEMAP
+CFCBase* CLOWNFISH_TYPE
CFCCBlock* CLOWNFISH_TYPE
CFCClass* CLOWNFISH_TYPE
CFCDocuComment* CLOWNFISH_TYPE