def print_header(self, bundle_name): self.bundle_name = bundle_name self._print_include_guard_header( get_include_guard_name('entity_lookup')) self.ctx.writeln('namespace ydk') self.ctx.writeln('{') self.ctx.bline() self.ctx.writeln("void {}_augment_lookup_tables();".format( snake_case(self.bundle_name))) self.ctx.bline() self.ctx.writeln('}') self._print_include_guard_trailer( get_include_guard_name('entity_lookup'))
def print_header(self, bundle_name): self.bundle_name = bundle_name self._print_include_guard_header(get_include_guard_name('entity_lookup')) self.ctx.writeln('#include <map>') self.ctx.writeln('#include <string>') self.ctx.writeln('#include <vector>') self.ctx.writeln('#include <unordered_map>') self.ctx.bline() self.ctx.writeln('namespace %s' % bundle_name) self.ctx.writeln('{') self.ctx.bline() self.ctx.writeln("void {}_augment_lookup_tables();".format(snake_case(self.bundle_name))) self.ctx.writeln("extern std::map<std::pair<std::string, std::string>, std::string> {0}_namespace_identity_lookup;".format(snake_case(self.bundle_name))) self.ctx.bline() self.ctx.writeln('}') self._print_include_guard_trailer(get_include_guard_name('entity_lookup'))
def __init__(self, package, file_index, fragmented): if sys.version_info > (3,): super().__init__(fragmented) else: super(MultiFileHeader, self).__init__(fragmented) self.file_name = _get_header_name(package, file_index) self.include_guard = get_include_guard_name(package.name, file_index)
def print_header(self, bundle_name): self.bundle_name = bundle_name self._print_include_guard_header( get_include_guard_name('entity_lookup')) self.ctx.writeln('#include <map>') self.ctx.writeln('#include <string>') self.ctx.bline() self.ctx.writeln('namespace %s' % bundle_name) self.ctx.writeln('{') self.ctx.bline() self.ctx.writeln("void {}_augment_lookup_tables();".format( snake_case(self.bundle_name))) self.ctx.writeln( "extern std::map<std::pair<std::string, std::string>, std::string> {0}_namespace_identity_lookup;" .format(snake_case(self.bundle_name))) self.ctx.bline() self.ctx.writeln('}') self._print_include_guard_trailer( get_include_guard_name('entity_lookup'))
def __init__(self, package, file_index, fragmented): super(MultiFileHeader, self).__init__(fragmented) self.file_name = _get_header_name(package, file_index) self.include_guard = get_include_guard_name(package.name, file_index)