def METHOD_NAME(cls_type):
	def n_hook(self, node):
		ext = '.obj' if self.env.CC_NAME == 'msvc' else '.o'
		name = node.name
		k = name.rfind('.')
		if k >= 0:
			basename = name[:k] + ext
		else:
			basename = name + ext
		outdir = node.parent.get_bld().make_node('%d' % self.idx)
		outdir.mkdir()
		out = outdir.find_or_declare(basename)
		task = self.create_task(cls_type, node, out)
		try:
			self.compiled_tasks.append(task)
		except AttributeError:
			self.compiled_tasks = [task]
		if not getattr(self, 'masters', None):
			self.masters = {}
			self.allmasters = []
		def fix_path(tsk):
			if self.env.CC_NAME == 'msvc':
				tsk.env.append_unique('CXX_TGT_F_BATCHED', '/Fo%s\\' % outdir.abspath())
		if not node.parent in self.masters:
			m = self.masters[node.parent] = self.master = self.create_task('batch')
			fix_path(m)
			self.allmasters.append(m)
		else:
			m = self.masters[node.parent]
			if len(m.slaves) > MAX_BATCH:
				m = self.masters[node.parent] = self.master = self.create_task('batch')
				fix_path(m)
				self.allmasters.append(m)
		m.add_slave(task)
		return task
	return n_hook