Documentation for CFCHierarchy
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/64e90373 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/64e90373 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/64e90373 Branch: refs/heads/cfc-pod-wip2 Commit: 64e90373ffaa7ace43fa4f533e5db6cac35cf88a Parents: 68ab737 Author: Nick Wellnhofer <[email protected]> Authored: Sat Jul 20 20:26:58 2013 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Wed Jun 25 17:45:00 2014 +0200 ---------------------------------------------------------------------- .../buildlib/Clownfish/CFC/Build/Binding.pm | 27 ++++++++++++++++++++ compiler/src/CFCHierarchy.h | 16 +++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/64e90373/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm ---------------------------------------------------------------------- diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm b/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm index 17e3a47..4930d3f 100644 --- a/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm +++ b/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm @@ -18,11 +18,38 @@ 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( + parcel => 'Clownfish', + 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-clownfish/blob/64e90373/compiler/src/CFCHierarchy.h ---------------------------------------------------------------------- diff --git a/compiler/src/CFCHierarchy.h b/compiler/src/CFCHierarchy.h index ed9df25..955ddda 100644 --- a/compiler/src/CFCHierarchy.h +++ b/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); @@ -93,12 +97,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);
