def print_impl(self):
		for svc_idl in self.data["service_idl"]:
			fd_h = None
			fd_cpp = None
			lines_h = None
			lines_cpp = None
			if not os.access(svc_idl.idl_fname, os.F_OK):
				sys.stderr.write("Error: IDL file \"" \
						 + svc_idl.idl_fname \
						 + "\" not found.\n")
				sys.exit(1)
			fd_h, lines_h = \
			    self.check_overwrite(svc_idl.impl_h)
			fd_cpp, lines_cpp = \
			    self.check_overwrite(svc_idl.impl_cpp)
			if not fd_h:
				sys.stderr.write("Cannot open file:" + 
						 svc_idl.impl_h + "\n")
				sys.exit(1)
			if not fd_cpp:
				sys.stderr.write("Cannot open file:" + 
						 svc_idl.impl_cpp + "\n")
				sys.exit(1)
			if lines_h or lines_cpp:
				sys.stderr.write("Merge of service impl." +
						 "code is not supported.\n")
				return

			try:
				idl_include = self.data["idl_include"]
				impl_suffix = self.data["impl_suffix"]
				skel_suffix = self.data["skel_suffix"]
				import cxx_svc_impl
				ifs = cxx_svc_impl.generate(svc_idl.idl_fname,
							    idl_include,
							    impl_suffix,
							    skel_suffix,
							    fd_h, fd_cpp)
				print "  File \"" \
				    + svc_idl.impl_h \
				    + "\" was generated."
				print "  File \"" \
				    + svc_idl.impl_cpp \
				    + "\" was generated."
			except:
				sys.stderr.write("Generate error: " \
						 + svc_idl.impl_h
						 + ", "
						 + svc_idl.impl_cpp + "\n")
Beispiel #2
0
						  impl_name = impl_flat_name,
						  fq_name = fqname,
						  fq_POA_name = "POA_" + cxx_fqname,
						  operations = defs)

		# Output the class methods implementations
		impls = string.join(map(lambda x: x + """\

{
  // Please insert your code here and remove the following warning pragma
#ifndef WIN32
  #warning "Code missing in function <""" + x + """>"
#endif
}

""",
								implementations), "")
		
		self.stream_cpp.out(interface_code,
							fqname = fqname,
							impl_name = impl_flat_name,
							impl_fqname = impl_flat_name,
							operations = impls)


if __name__ == "__main__":
	import cxx_svc_impl
	import sys
	print "Interfaces:"
	print cxx_svc_impl.generate(sys.argv[1], "SVC_impl")
Beispiel #3
0
						  impl_name = impl_flat_name,
						  fq_name = fqname,
						  fq_POA_name = "POA_" + cxx_fqname,
						  operations = defs)

		# Output the class methods implementations
		impls = string.join(map(lambda x: x + """\

{
  // Please insert your code here and remove the following warning pragma
#ifndef WIN32
  #warning "Code missing in function <""" + x + """>"
#endif
}

""",
								implementations), "")
		
		self.stream_cpp.out(interface_code,
							fqname = fqname,
							impl_name = impl_flat_name,
							impl_fqname = impl_flat_name,
							operations = impls)


if __name__ == "__main__":
	import cxx_svc_impl
	import sys
	print "Interfaces:"
	print cxx_svc_impl.generate(sys.argv[1], "SVC_impl")