Class: Rbind::RTemplateClass
- Defined in:
- lib/rbind/core/rtemplate_class.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from RClass
Attributes inherited from RNamespace
#consts, #operation_alias, #operations, #root, #type_alias, #used_namespaces
Attributes inherited from RDataType
#cdelete_method, #check_type, #invalid_value, #ptr, #ref, #typedef
Attributes inherited from RBase
#alias, #auto_alias, #cname, #csignature, #doc, #extern_package_name, #ignore, #name, #namespace, #owner, #signature, #version
Instance Method Summary collapse
-
#do_specialize(name, *parameters) ⇒ Object
called by RNamespace.
-
#initialize(name, *parent_classes) ⇒ RTemplateClass
constructor
A new instance of RTemplateClass.
-
#specialize(klass, *parameters) ⇒ Object
hook for implementing the specialization.
-
#specialize_ruby_specialization(klass) ⇒ Object
hook for generating additional ruby code going to be embedded into the class definition.
- #template? ⇒ Boolean
Methods inherited from RClass
#add_attribute, #add_parent, #attribute, #basic_type?, #cdelete_method, #constructor?, #empty?, #operation, #operations, #parent_class, #pretty_print, #pretty_print_name, #used_namespaces
Methods inherited from RNamespace
#add_const, #add_default_types, #add_namespace, #add_operation, #add_simple_type, #add_simple_types, #add_type, #const, #constructor?, #container?, #delete_type, #each_const, #each_container, #each_operation, #each_type, #empty?, #extern?, #method_missing, #operation, #operation?, #pretty_print, #pretty_print_name, #root?, #type, #types, #use_namespace
Methods inherited from RDataType
#==, #basic_type?, #check_type?, #cname, #const?, #container?, #ptr?, #raw?, #ref?, #remove_const, #to_const, #to_ptr, #to_raw, #to_ref, #to_single_ptr, #typedef?
Methods inherited from RBase
basename, #binding, #delete!, #extern?, #full_name, #generate_signatures, #ignore?, #map_to_namespace, namespace, #namespace?, normalize, #pretty_print, #rename, #specialize_ruby, split_name, to_cname, #to_s
Constructor Details
#initialize(name, *parent_classes) ⇒ RTemplateClass
Returns a new instance of RTemplateClass.
25 26 27 28 |
# File 'lib/rbind/core/rtemplate_class.rb', line 25 def initialize(name,*parent_classes) raise "parent classes for template classes are not supported!" if !parent_classes.empty? super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rbind::RNamespace
Instance Method Details
#do_specialize(name, *parameters) ⇒ Object
called by RNamespace
35 36 37 38 |
# File 'lib/rbind/core/rtemplate_class.rb', line 35 def do_specialize(name,*parameters) klass = RTemplateClassSpecialization.new(name,self,*parameters) specialize(klass,*parameters) end |
#specialize(klass, *parameters) ⇒ Object
hook for implementing the specialization
41 42 |
# File 'lib/rbind/core/rtemplate_class.rb', line 41 def specialize(klass,*parameters) end |
#specialize_ruby_specialization(klass) ⇒ Object
hook for generating additional ruby code going to be embedded into the class definition
46 47 |
# File 'lib/rbind/core/rtemplate_class.rb', line 46 def specialize_ruby_specialization(klass) end |
#template? ⇒ Boolean
30 31 32 |
# File 'lib/rbind/core/rtemplate_class.rb', line 30 def template? true end |