示例#1
0
def protocol_include(code_path, mess_name_ids):
	file_name		= code_path + 'pb.hpp'

	_str_include	= '#ifndef _PROTOCOLS_\n#define _PROTOCOLS_\n\n#include <list>\n\n#include <pb_type.hpp>\n#include <Packet.hpp>\n\n#include <Msg.hpp>\n\n'

	for mess_name_id in mess_name_ids:
		mess_name 	= mess_name_id['mess_name']

		_str_include	+= '#include <' + tool.cpp_class_name(mess_name) + '.cpp>\n'

	_str_msg = _str_include + '\n#endif\n'
	with open(file_name, 'w+') as fd:
		fd.write(_str_msg)
示例#2
0
def protocol_include(code_path, mess_name_ids):
    file_name = code_path + 'pb.hpp'

    _str_include = '#ifndef _PROTOCOLS_\n#define _PROTOCOLS_\n\n#include <list>\n\n#include <pb_type.hpp>\n#include <Packet.hpp>\n\n#include <Msg.hpp>\n\n'

    for mess_name_id in mess_name_ids:
        mess_name = mess_name_id['mess_name']

        _str_include += '#include <' + tool.cpp_class_name(
            mess_name) + '.cpp>\n'

    _str_msg = _str_include + '\n#endif\n'
    with open(file_name, 'w+') as fd:
        fd.write(_str_msg)
示例#3
0
 def _set_class_name(self):
     self._str_msg_name = tool.cpp_proto_name_msg(self._mess_name)
     self._str_class_name = tool.cpp_class_name(self._mess_name)
     self._filename = self._code_path + self._str_class_name + '.cpp'
示例#4
0
	def _set_class_name(self):
		self._str_msg_name 	= tool.cpp_proto_name_msg(self._mess_name)
		self._str_class_name= tool.cpp_class_name(self._mess_name)
		self._filename		= self._code_path + self._str_class_name + '.cpp'