lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [5/6] git commit: refs/heads/cfc-pod - Documentation for CFCHierarchy
Date Sat, 20 Jul 2013 20:38:01 GMT
Documentation for CFCHierarchy


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/d20b48e6
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/d20b48e6
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/d20b48e6

Branch: refs/heads/cfc-pod
Commit: d20b48e638f468d354e45f444c486a87c14d9846
Parents: 4d89fd6
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sat Jul 20 20:26:58 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sat Jul 20 20:26:58 2013 +0200

----------------------------------------------------------------------
 .../buildlib/Clownfish/CFC/Build/Binding.pm     | 26 ++++++++++++++++++++
 clownfish/compiler/src/CFCHierarchy.h           | 16 +++++++++---
 2 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/d20b48e6/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm b/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
index 1623ade..1de4fd7 100644
--- a/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
+++ b/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
@@ -18,11 +18,37 @@ use strict;
 
 sub bind_all {
     my $class = shift;
+    $class->bind_hierarchy;
     $class->bind_perl;
     $class->bind_perlclass;
     $class->bind_perlpod;
 }
 
+sub bind_hierarchy {
+    class_from_c('CFCHierarchy', 'Clownfish::CFC::Model::Hierarchy');
+
+    my @exposed = qw(
+        Add_Source_Dir
+        Add_Include_Dir
+        Build
+        Ordered_Classes
+        Get_Source_Dirs
+        Get_Include_Dirs
+        Get_Dest
+    );
+
+    my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
+    $pod_spec->add_constructor( alias => 'new' );
+    $pod_spec->add_method( method => $_, alias => lc($_) ) for @exposed;
+
+    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
+        class_name => 'Clownfish::CFC::Model::Hierarchy',
+    );
+    $binding->set_pod_spec($pod_spec);
+
+    Clownfish::CFC::Binding::Perl::Class->register($binding);
+}
+
 sub bind_perl {
     class_from_c('CFCPerl', 'Clownfish::CFC::Binding::Perl');
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/d20b48e6/clownfish/compiler/src/CFCHierarchy.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCHierarchy.h b/clownfish/compiler/src/CFCHierarchy.h
index f04edb6..80795d0 100644
--- a/clownfish/compiler/src/CFCHierarchy.h
+++ b/clownfish/compiler/src/CFCHierarchy.h
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-/** Clownfish::CFC::Model::Hierarchy - A class hierarchy.
+/** A class hierarchy.
  *
  * A Clownfish::CFC::Model::Hierarchy consists of all the classes defined in
  * files within a source directory and its subdirectories.
@@ -47,12 +47,16 @@ CFCHierarchy_init(CFCHierarchy *self, const char *dest);
 void
 CFCHierarchy_destroy(CFCHierarchy *self);
 
-/** Add path C<source_dir> to the list of source directories.
+/** Add a path to the list of source directories.
+ *
+ * @param source_dir The source directory.
  */
 void
 CFCHierarchy_add_source_dir(CFCHierarchy *self, const char *source_dir);
 
-/** Add path C<include_dir> to the list of include directories.
+/** Add a path to the list of include directories.
+ *
+ * @param source_dir The include directory.
  */
 void
 CFCHierarchy_add_include_dir(CFCHierarchy *self, const char *include_dir);
@@ -80,12 +84,18 @@ CFCHierarchy_ordered_classes(CFCHierarchy *self);
 struct CFCFile**
 CFCHierarchy_files(CFCHierarchy *self);
 
+/** Accessor for source directories.
+ */
 const char**
 CFCHierarchy_get_source_dirs(CFCHierarchy *self);
 
+/** Accessor for include directories.
+ */
 const char**
 CFCHierarchy_get_include_dirs(CFCHierarchy *self);
 
+/** Accessor for destination directory.
+ */
 const char*
 CFCHierarchy_get_dest(CFCHierarchy *self);
 


Mime
View raw message