예제 #1
0
    def templates(self, component):
        templates = [
            CppTemplate('resource.cpp',
                        component['userclass']['file'],
                        userfile=True),
            CppTemplate('resource.h',
                        component['userclass']['header'],
                        userfile=True),
            CppTemplate('pull/resource_base.cpp',
                        component['baseclass']['file']),
            CppTemplate('pull/resource_base.h',
                        component['baseclass']['header']),
            CppTemplate('programmable_base.h',
                        component['reprogclass']['header']),
            CppTemplate('entry_point.h', userfile=True),
            CppTemplate('base/main.cpp'),
            AutomakeTemplate('base/Makefile.am'),
            AutomakeTemplate('base/Makefile.am.ide', userfile=True),
            AutoconfTemplate('base/configure.ac'),
            ShellTemplate('base/build.sh'),
            ShellTemplate('common/reconf')
        ]

        for gen in component['portgenerators']:
            # Need to include port_impl if a non-bulkio port exists
            if str(type(gen)).find("BulkioPortGenerator") == -1:
                templates.append(CppTemplate('pull/port_impl.cpp'))
                templates.append(CppTemplate('pull/port_impl.h'))
                break

        if component['structdefs']:
            templates.append(CppTemplate('pull/struct_props.h'))

        return templates
예제 #2
0
    def templates(self, component):
        templates = [
            CppTemplate('main.cpp'),
            CppTemplate('resource.cpp', component['userclass']['file']),
            CppTemplate('resource.h', component['userclass']['header']),
            CppTemplate('resource_base.cpp', component['baseclass']['file']),
            CppTemplate('resource_base.h', component['baseclass']['header']),
            CppTemplate('GnuHawkBlock.h',
                        component['prefix'] + '_GnuHawkBlock.h'),
            AutomakeTemplate('Makefile.am'),
            AutomakeTemplate('Makefile.am.ide'),
            AutoconfTemplate('configure.ac'),
            ShellTemplate('reconf')
        ]

        for gen in component['portgenerators']:
            # Need to include port_impl if a non-bulkio port exists
            if str(type(gen)).find("BulkioPortGenerator") == -1:
                templates.append(CppTemplate('pull/port_impl.cpp'))
                templates.append(CppTemplate('pull/port_impl.h'))
                break

        if component['structdefs']:
            templates.append(CppTemplate('struct_props.h'))

        return templates
예제 #3
0
    def templates(self, component):
        templates = [
            CppTemplate('resource.cpp',
                        component['userclass']['file'],
                        userfile=True),
            CppTemplate('resource.h',
                        component['userclass']['header'],
                        userfile=True),
            CppTemplate('pull/resource_base.cpp',
                        component['baseclass']['file']),
            CppTemplate('pull/resource_base.h',
                        component['baseclass']['header']),
            CppTemplate('main.cpp', userfile=True),
            AutomakeTemplate('Makefile.am'),
            AutomakeTemplate('base/Makefile.am.ide', userfile=True),
            AutoconfTemplate('configure.ac'),
            ShellTemplate('base/build.sh'),
            ShellTemplate('common/reconf')
        ]

        is_device = True
        is_executable = False
        for superclass in component['superclasses']:
            if superclass['name'] == 'Resource_impl':
                is_device = False
            if superclass['name'] == 'ExecutableDevice_impl':
                is_executable = True

        # Append programmable files if it's a persona device
        if is_device:
            templates.append(
                CppTemplate('persona_base.cpp',
                            component['reprogclass']['file'],
                            userfile=True))
            templates.append(
                CppTemplate('persona_base.h',
                            component['reprogclass']['header'],
                            userfile=True))

        # Append entry_point file if it's an executable device
        if is_executable:
            templates.append(CppTemplate('entry_point.h', userfile=True))

        # Add port implementations if required
        templates.extend(
            CppTemplate('pull/' + fn)
            for fn in self.getPortTemplates(component))

        if component['structdefs']:
            templates.append(CppTemplate('pull/struct_props.h'))

        return templates
예제 #4
0
    def templates(self, library):
        userHeader = os.path.join(self.includedir, library['incfile'])
        userSource = os.path.join(self.sourcedir, library['srcfile'])

        templates = [
            CppTemplate('library.h', userHeader, userfile=True),
            CppTemplate('library.cpp', userSource, userfile=True),
            AutomakeTemplate('Makefile.am'),
            AutomakeTemplate('base/Makefile.am.ide', userfile=True),
            AutoconfTemplate('configure.ac'),
            ShellTemplate('base/build.sh'),
            ShellTemplate('common/reconf'),
            PkgconfigTemplate('library.pc.in', library['pcfile']+'.in')
        ]

        return templates
예제 #5
0
    def templates(self, component):
        templates = [
            CppTemplate('base/main.cpp'),
            AutomakeTemplate('base/Makefile.am'),
            AutomakeTemplate('base/Makefile.am.ide', userfile=True),
            AutoconfTemplate('base/configure.ac'),
            ShellTemplate('base/build.sh'),
            ShellTemplate('common/reconf'),
            CppTemplate('resource.cpp',
                        component['userclass']['file'],
                        userfile=True),
            CppTemplate('resource.h',
                        component['userclass']['header'],
                        userfile=True),
            CppTemplate('resource_base.cpp', component['baseclass']['file']),
            CppTemplate('resource_base.h', component['baseclass']['header'])
        ]

        # Add port implementations if required
        templates.extend(
            CppTemplate(fn) for fn in self.getPortTemplates(component))

        if component['structdefs']:
            templates.append(CppTemplate('struct_props.h'))

        return templates
예제 #6
0
    def templates(self, component):
        templates = [
            CppTemplate('main.cpp'),
            CppTemplate('service.cpp',
                        component['userclass']['file'],
                        userfile=True),
            CppTemplate('service.h',
                        component['userclass']['header'],
                        userfile=True),
            CppTemplate('service_base.cpp', component['baseclass']['file']),
            CppTemplate('service_base.h', component['baseclass']['header']),
            AutomakeTemplate('Makefile.am'),
            AutomakeTemplate('Makefile.am.ide', userfile=True),
            AutoconfTemplate('configure.ac'),
            ShellTemplate('build.sh'),
            ShellTemplate('common/reconf')
        ]

        return templates
예제 #7
0
    def templates(self, component):
        templates = [
            CppTemplate('main.cpp'),
            AutomakeTemplate('Makefile.am'),
            AutomakeTemplate('Makefile.am.ide', userfile=True),
            AutoconfTemplate('configure.ac'),
            ShellTemplate('build.sh'),
            ShellTemplate('common/reconf')
        ]

        return templates
예제 #8
0
    def templates(self, library):
        templates = [
            #CppTemplate('resource.h', userHeader, userfile=True),
            #CppTemplate('resource.cpp', userSource, userfile=True),
            CppTemplate('resource.h', self.plugin_name + '.h', userfile=True),
            CppTemplate('resource.cpp',
                        self.plugin_name + '.cpp',
                        userfile=True),
            CppTemplate('resource_base.h', self.plugin_name + '_base.h'),
            CppTemplate('resource_base.cpp', self.plugin_name + '_base.cpp'),
            CppTemplate('struct_props.h'),
            CppTemplate('main.cpp'),
            SpecfileTemplate('plugin.spec', self.plugin_name + '.spec'),
            AutomakeTemplate('Makefile.am'),
            AutomakeTemplate('base/Makefile.am.ide', userfile=True),
            AutoconfTemplate('configure.ac'),
            ShellTemplate('base/build.sh'),
            ShellTemplate('common/reconf')
        ]

        return templates
예제 #9
0
 def _implementation(self):
     return CppTemplate('generic.provides.cpp')
예제 #10
0
 def _declaration(self):
     return CppTemplate('generic.provides.h')