mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	expose polymorphism through python wrappers
This commit is contained in:
		
							parent
							
								
									3c9371589d
								
							
						
					
					
						commit
						362e3aa40f
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
					@ -806,6 +806,8 @@ class WClass:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for con in self.found_constrs:
 | 
								for con in self.found_constrs:
 | 
				
			||||||
				text += con.gen_decl()
 | 
									text += con.gen_decl()
 | 
				
			||||||
 | 
								if self.base_class is not None:
 | 
				
			||||||
 | 
									text += "\n\t\tvirtual ~" + self.name + "() { };"
 | 
				
			||||||
			for var in self.found_vars:
 | 
								for var in self.found_vars:
 | 
				
			||||||
				text += var.gen_decl()
 | 
									text += var.gen_decl()
 | 
				
			||||||
			for fun in self.found_funs:
 | 
								for fun in self.found_funs:
 | 
				
			||||||
| 
						 | 
					@ -910,15 +912,19 @@ class WClass:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def gen_boost_py(self):
 | 
						def gen_boost_py(self):
 | 
				
			||||||
		body = self.gen_boost_py_body()
 | 
							body = self.gen_boost_py_body()
 | 
				
			||||||
 | 
							base_info = ""
 | 
				
			||||||
 | 
							if self.base_class is not None:
 | 
				
			||||||
 | 
								base_info = ", bases<%s::%s>" % (self.base_class.namespace, self.base_class.name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if self.link_type == link_types.derive:
 | 
							if self.link_type == link_types.derive:
 | 
				
			||||||
			text = "\n\t\tclass_<" + self.name + ">(\"Cpp" + self.name + "\""
 | 
								text = "\n\t\tclass_<" + self.name + base_info + ">(\"Cpp" + self.name + "\""
 | 
				
			||||||
			text += body
 | 
								text += body
 | 
				
			||||||
			text += "\n\t\tclass_<" + self.name
 | 
								text += "\n\t\tclass_<" + self.name
 | 
				
			||||||
			text += "Wrap, boost::noncopyable"
 | 
								text += "Wrap, boost::noncopyable"
 | 
				
			||||||
			text += ">(\"" + self.name + "\""
 | 
								text += ">(\"" + self.name + "\""
 | 
				
			||||||
			text += body
 | 
								text += body
 | 
				
			||||||
		else:
 | 
							else:
 | 
				
			||||||
			text = "\n\t\tclass_<" + self.name + ">(\"" + self.name + "\""
 | 
								text = "\n\t\tclass_<" + self.name + base_info + ">(\"" + self.name + "\""
 | 
				
			||||||
			text += body
 | 
								text += body
 | 
				
			||||||
		return text
 | 
							return text
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue