Exemplo n.º 1
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """
    global_ns.exclude()
    classes = []

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    # EventPlayer
    EventPlayer = local_ns.class_('EventPlayer')
    EventPlayer.include()
    classes.append(EventPlayer)

    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Do class wide items
    wrap.add_needed_includes(classes)

    # Add registrations functions for hand wrapped classes
    module_builder.add_registration_code("registerLoggingPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/logging/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 2
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """
    global_ns.exclude()
    classes = []

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    # EventPlayer
    EventPlayer = local_ns.class_('EventPlayer')
    EventPlayer.include()
    classes.append(EventPlayer)

    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Do class wide items
    wrap.add_needed_includes(classes)

    # Add registrations functions for hand wrapped classes
    module_builder.add_registration_code("registerLoggingPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/logging/include/RegisterFunctions.h'
            ] + list(include_files)
Exemplo n.º 3
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """
    classes = []

    local_ns.exclude()

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True
    module_builder.class_('::ram::math::Vector3').already_exposed = True
    module_builder.class_('::ram::math::Vector2').already_exposed = True
    Quaternion = module_builder.class_('::ram::math::Quaternion')
    Quaternion.already_exposed = True
    Quaternion.constructors().allow_implicit_conversion = False

    # Wrap Events
    events = wrap.expose_events(local_ns)
    if events:
        module_builder.class_('::ram::core::Event').already_exposed = True
        classes += events

    # Include obstacle class
    Obstacle = local_ns.class_('Obstacle')
    Obstacle.include()

    Obstacle.include_files.append(os.environ['RAM_SVN_DIR'] +
                                  '/packages/estimation/include/Obstacle.h')

    # Include state estimator class
    IStateEstimator = local_ns.class_('IStateEstimator')
    IStateEstimator.include()

    IStateEstimator.include_files.append(
        os.environ['RAM_SVN_DIR'] +
        '/packages/estimation/include/IStateEstimator.h')
    classes.append(IStateEstimator)

    wrap.registerSubsystemConverter(IStateEstimator)

    module_builder.add_registration_code("registerIStateEstimatorPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/estimation/include/RegisterFunctions.h'
            ] + list(include_files)
Exemplo n.º 4
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """
    classes = []

    local_ns.exclude()

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True
    module_builder.class_('::ram::math::Vector3').already_exposed = True
    module_builder.class_('::ram::math::Vector2').already_exposed = True
    Quaternion = module_builder.class_('::ram::math::Quaternion')
    Quaternion.already_exposed = True
    Quaternion.constructors().allow_implicit_conversion = False

    # Wrap Events
    events = wrap.expose_events(local_ns)
    if events:
        module_builder.class_('::ram::core::Event').already_exposed = True
        classes += events

    # Include obstacle class
    Obstacle = local_ns.class_('Obstacle')
    Obstacle.include()

    Obstacle.include_files.append(os.environ['RAM_SVN_DIR'] +
                                  '/packages/estimation/include/Obstacle.h')

    # Include state estimator class
    IStateEstimator = local_ns.class_('IStateEstimator')
    IStateEstimator.include()

    IStateEstimator.include_files.append(os.environ['RAM_SVN_DIR'] +
                                         '/packages/estimation/include/IStateEstimator.h')
    classes.append(IStateEstimator)

    wrap.registerSubsystemConverter(IStateEstimator)

    module_builder.add_registration_code("registerIStateEstimatorPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/estimation/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 5
0
mfuns = namespace_osiris.mem_funs(allow_empty=True)
mfuns.add_default_precall_code("::osiris::PythonThreadSaver __pythreadSaver;")
mfuns.add_override_precall_code("::osiris::PythonState __pystate(getPythonThreadState());")
mfuns.add_override_native_precall_code("__pystate.leave();")

initAlreadyExposedClasses(module_builder)
includeClasses(namespace_osiris)
includeEnumerations(namespace_osiris)
applyDefaultReturnPolicies(mfuns)

module_builder.build_code_creator(module_name = settings.module_name)
module_builder.code_creator.user_defined_directories.append(settings.root_dir)

module_builder.add_declaration_code('#include "pythonmanualwrappers.h"')
module_builder.add_registration_code("OS_NAMESPACE_NAME::initPythonManualWrappers();", False)

module_builder.code_creator.replace_included_headers([])		# Rimuove tutti gli headers inclusi automaticamente (wrappers.h in particolare che non deve essere incluso in ogni classe)
module_builder.code_creator.adopt_creator(code_creators.include_t("stdafx.h"), 0)
module_builder.code_creator.adopt_creator(code_creators.include_t("pypluspluscommon.h"), 1)

####################################################################################################

# I nomi dei files rispecchiano quelli delle classi, ma nell'include dei wrapper vengono generati in minuscolo da Py++ (il che crea problemi sotto linux...)
# Questa funzione fa da wrapper a quella originale passando il nome del file sempre in minuscolo
original_write_file = pyplusplus.file_writers.multiple_files.multiple_files_t.write_file
def make_lower_write_file(self, fpath, content):
	splittedPath = os.path.split(fpath)
	fpath = os.path.join(splittedPath[0], splittedPath[1].lower())	
	original_write_file(self, fpath, content)
pyplusplus.file_writers.multiple_files.multiple_files_t.write_file = make_lower_write_file
Exemplo n.º 6
0
def generate(module_builder, local_ns, global_ns):
    """
    name: is the name of the module being wrapped (in name::space::form)
    global_ns: is the module builder for the entire library
    local_ns: is the namespace that coresponds to the given namespace
    """

    # Remove all those pesky warnings about only pointed to types!
    for cls in local_ns.decls(decl_type=decls_package.class_declaration_t):
        cls.include()
        cls.already_exposed = True

    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    classes = []

    # Include IVehicle class and handle special cases
    IVehicle = local_ns.class_('IVehicle')
    IVehicle.include()
    classes.append(IVehicle)

    # Remove default wrapper for getDevice
    IVehicle.member_function('getDevice').exclude()

    # Provide the normal one by hand, so C++ users of python subclasses
    # still get the overridden method
    IVehicle.add_wrapper_code("""
    virtual ::ram::vehicle::device::IDevicePtr getDevice( ::std::string name ){
        bp::override func = this->get_override(\"getDevice\");
        return func( name);
    }
    """)

    # Provide a hand made implementation for Python users of C++ IVehicle
    # subclasses, this uses our custom converter to ensure proper IDevice
    # downcasting
    IVehicle.add_declaration_code("""
    boost::python::object pyGetDevice(
        ram::vehicle::IVehicle& veh,
        std::string deviceName)
    {
        ram::vehicle::device::IDevicePtr device =
            veh.getDevice(deviceName);
        return ram::vehicle::device::IDeviceConverter::convertObject(device);
    }
    """)
    IVehicle.add_registration_code("def(\"getDevice\", &::pyGetDevice)",
                                   works_on_instance = True )
    IVehicle.include_files.append('vehicle/include/device/IDeviceConverter.h')

    global_ns.typedef('TempNameList').type.declaration.already_exposed = True
    global_ns.typedef('TempList').include()

    # Fix TempNameList (the include does stick)
    t = global_ns.class_(function =
                         lambda x: x.name.startswith('vector<std::string'))
    t.already_exposed = True

    # Fix overley long std::container names
    #wrap.mangle_container_names(local_ns)

    # Wrap Events
    events = wrap.expose_events(local_ns)
    if events:
        module_builder.class_('::ram::core::Event').already_exposed = True
        classes += events
    
    # Added the needed includes
    wrap.add_needed_includes(classes)
    IVehicle.include_files.append(os.environ['RAM_SVN_DIR'] +
                                  '/packages/vehicle/include/device/IDevice.h')

    # Add a castTo
    wrap.registerSubsystemConverter(IVehicle)

    module_builder.add_registration_code("registerIVehiclePtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/vehicle/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 7
0
def generate(module_builder, local_ns, global_ns):
    """
    global_ns: is the module builder for the entire library
    local_ns: is the namespace that coresponds to the given namespace
    """
    
    # Remove all those pesky warnings about only pointed to types!
    for cls in local_ns.decls(decl_type=decls_package.class_declaration_t):
        cls.include()
        cls.already_exposed = True

    module_builder.class_('::ram::core::EventPublisher').already_exposed = True
    module_builder.class_('::ram::core::IUpdatable').already_exposed = True

    wrappedClasses = []

    # Wrap IDevice Class
    IDevice = expose_device(local_ns, 'IDevice', register = False);
    wrappedClasses.append(IDevice)

    # Wrap the thruster class
    IThruster = expose_device(local_ns, 'IThruster')
    wrappedClasses.append(IThruster)

    # Wrap the IDepthSensor class
    IDepthSensor = expose_device(local_ns, 'IDepthSensor')
    wrappedClasses.append(IDepthSensor)

    # Wrap marker interfaces (slightly abuse expose device)
    IVoltageProvider = expose_device(local_ns, 'IVoltageProvider',
                                     register = False)
    wrappedClasses.append(IVoltageProvider)
    ICurrentProvider = expose_device(local_ns, 'ICurrentProvider',
                                     register = False)
    wrappedClasses.append(ICurrentProvider)

    # Wrap the IPowerSource class
    IPowerSource = expose_device(local_ns, 'IPowerSource')
    wrappedClasses.append(IPowerSource)

    # Wrap the ITempSensor class
    ITempSensor = expose_device(local_ns, 'ITempSensor')
    wrappedClasses.append(ITempSensor)

    # Wrap the IIMU class
    IIMU = expose_device(local_ns, 'IIMU')
    wrappedClasses.append(IIMU)

    # Wrap the ISonar class
    ISonar = expose_device(local_ns, 'ISonar')
    wrappedClasses.append(ISonar)

    # Wrap the IPayloadSet class
    IPayloadSet = expose_device(local_ns, 'IPayloadSet')
    wrappedClasses.append(IPayloadSet)

    # Wrap the IVelocitySensor class
    IVelocitySensor = expose_device(local_ns, 'IVelocitySensor')
    wrappedClasses.append(IVelocitySensor)

    # Wrap the IPositionSensor class
    IPositionSensor = expose_device(local_ns, 'IPositionSensor')
    wrappedClasses.append(IPositionSensor)

    # Wrap Events
    events = wrap.expose_events(local_ns)
    if events:
        module_builder.class_('::ram::core::Event').already_exposed = True
        classes += events

    module_builder.add_registration_code("registerIDeviceMakerClass();")
    module_builder.add_registration_code("registerIDevicePtrs();")
    wrap.add_needed_includes(wrappedClasses)

    include_files = set([cls.location.file_name for cls in wrappedClasses])
    for cls in wrappedClasses:
        include_files.update(cls.include_files)
    return ['wrappers/vehicle/include/RegisterFunctions.h',
            'core/include/Event.h'] + list(include_files)
Exemplo n.º 8
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """

    local_ns.exclude()
    classes = []

    # ConfigNode
    ConfigNode = local_ns.class_('ConfigNode')
    ConfigNode.include()
    ConfigNode.constructors().exclude()
    classes.append(ConfigNode)

    # Event Subsystem
    EventPublisher = expose_publisher(local_ns, 'EventPublisher')
    EventPublisher.include_files.append('core/include/EventHub.h')

    # Apply return value policy
    lookupByName = EventPublisher.member_function('lookupByName')
    lookupByName.call_policies = \
        mod_builder.call_policies.return_value_policy(
            mod_builder.call_policies.manage_new_object)
    classes.append(EventPublisher)

    QueuedEventPublisher = expose_publisher(local_ns, 'QueuedEventPublisher')
    classes.append(QueuedEventPublisher)

    # EventConnection
    EventConnection = local_ns.class_('EventConnection')
    EventConnection.include()
    EventConnection.include_files.append('core/include/EventConnection.h')
    classes.append(EventConnection)

    # IUpdatable
    IUpdatable = local_ns.class_('IUpdatable')
    IUpdatable.include()
    classes.append(IUpdatable)

    # Application
    Application = local_ns.class_('Application')
    Application.include()

    # Replace getSubsystem with one which uses our converter
    Application.member_function('getSubsystem').exclude()
    Application.add_declaration_code("""
    boost::python::object pyGetSubsystem(ram::core::Application& app,
                                         std::string subsystemName)
    {
        ram::core::SubsystemPtr subsystem = app.getSubsystem(subsystemName);
        return ram::core::SubsystemConverter::convertObject(subsystem);
    }
    """)
    Application.add_registration_code('def("getSubsystem", &::pyGetSubsystem)',
                                      works_on_instance=True)
    Application.include_files.append('core/include/SubsystemConverter.h')

    classes.append(Application)

    # Wrap Events
    Event = local_ns.class_('Event')
    Event.include()
    classes.append(Event)

    def filterFunc(val):
        return val.name.endswith('Event') and val.name != 'Event'

    events = wrap.expose_events(local_ns, filter_func=filterFunc)
    classes += events

    # Add registrations functions for hand wrapped classes
    module_builder.add_registration_code("registerSubsystemList();")
    module_builder.add_registration_code("registerSubsystemClass();")
    module_builder.add_registration_code("registerSubsystemMakerClass();")
    module_builder.add_registration_code("registerEventHubClass();")
    module_builder.add_registration_code("registerQueuedEventHubClass();")

    # Do class wide items
    wrap.set_implicit_conversions(
        [Application, QueuedEventPublisher, EventPublisher], False)
    wrap.add_needed_includes(classes)

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/core/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 9
0
def generate(module_builder, local_ns, global_ns):
    """
    global_ns: is the module builder for the entire library
    local_ns: is the namespace that coresponds to the given namespace
    """
    global_ns.exclude()
    classes = []

    # Lets Py++ know to make VisionSystem a subclass of Subsystem
    module_builder.class_('::ram::core::Subsystem').already_exposed = True
    module_builder.class_('::ram::core::Event').already_exposed = True

    # Vision System
    VisionSystem = local_ns.class_('VisionSystem')
    VisionSystem.include()
    VisionSystem.include_files.append('vision/include/Camera.h')
    classes.append(VisionSystem)   

    # Wrap Events
    EventType = local_ns.class_('EventType')
    EventType.include()
    classes.append(EventType)

    Symbol = local_ns.class_('Symbol')
    Symbol.include()
    Symbol.member_function('getSymbolNames').exclude()
    Symbol.member_function('symbolToText').exclude()
    classes.append(Symbol)

    Color = local_ns.class_('Color')
    Color.include()
    Color.member_function('getColorNames').exclude()
    Color.member_function('colorToText').exclude()
    classes.append(Color)
    
    events = wrap.expose_events(local_ns)
    classes += events

    ImageEvent = local_ns.class_('ImageEvent')
    ImageEvent.include_files.append('vision/include/Image.h')
    wrap.set_implicit_conversions([ImageEvent], False)

    BinEvent = local_ns.class_('BinEvent')
    wrap.set_implicit_conversions([BinEvent], False)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Append the approaite include files
#    for cls in classes:
#        cls.include()
    wrap.add_needed_includes(classes)

    module_builder.add_registration_code("registerImageClass();")
    module_builder.add_registration_code("registerCameraClass();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/vision/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 10
0
def generate(module_builder, local_ns, global_ns):
    """
    global_ns: is the module builder for the entire library
    local_ns: is the namespace that coresponds to the given namespace
    """

    # Remove all those pesky warnings about only pointed to types!
    for cls in local_ns.decls(decl_type=decls_package.class_declaration_t):
        cls.include()
        cls.already_exposed = True

    module_builder.class_('::ram::core::EventPublisher').already_exposed = True
    module_builder.class_('::ram::core::IUpdatable').already_exposed = True

    wrappedClasses = []

    # Wrap IDevice Class
    IDevice = expose_device(local_ns, 'IDevice', register=False)
    wrappedClasses.append(IDevice)

    # Wrap the thruster class
    IThruster = expose_device(local_ns, 'IThruster')
    wrappedClasses.append(IThruster)

    # Wrap the IDepthSensor class
    IDepthSensor = expose_device(local_ns, 'IDepthSensor')
    wrappedClasses.append(IDepthSensor)

    # Wrap marker interfaces (slightly abuse expose device)
    IVoltageProvider = expose_device(local_ns,
                                     'IVoltageProvider',
                                     register=False)
    wrappedClasses.append(IVoltageProvider)
    ICurrentProvider = expose_device(local_ns,
                                     'ICurrentProvider',
                                     register=False)
    wrappedClasses.append(ICurrentProvider)

    # Wrap the IPowerSource class
    IPowerSource = expose_device(local_ns, 'IPowerSource')
    wrappedClasses.append(IPowerSource)

    # Wrap the ITempSensor class
    ITempSensor = expose_device(local_ns, 'ITempSensor')
    wrappedClasses.append(ITempSensor)

    # Wrap the IIMU class
    IIMU = expose_device(local_ns, 'IIMU')
    wrappedClasses.append(IIMU)

    # Wrap the ISonar class
    ISonar = expose_device(local_ns, 'ISonar')
    wrappedClasses.append(ISonar)

    # Wrap the IPayloadSet class
    IPayloadSet = expose_device(local_ns, 'IPayloadSet')
    wrappedClasses.append(IPayloadSet)

    # Wrap the IVelocitySensor class
    IVelocitySensor = expose_device(local_ns, 'IVelocitySensor')
    wrappedClasses.append(IVelocitySensor)

    # Wrap the IPositionSensor class
    IPositionSensor = expose_device(local_ns, 'IPositionSensor')
    wrappedClasses.append(IPositionSensor)

    # Wrap Events
    events = wrap.expose_events(local_ns)
    if events:
        module_builder.class_('::ram::core::Event').already_exposed = True
        classes += events

    module_builder.add_registration_code("registerIDeviceMakerClass();")
    module_builder.add_registration_code("registerIDevicePtrs();")
    wrap.add_needed_includes(wrappedClasses)

    include_files = set([cls.location.file_name for cls in wrappedClasses])
    for cls in wrappedClasses:
        include_files.update(cls.include_files)
    return [
        'wrappers/vehicle/include/RegisterFunctions.h', 'core/include/Event.h'
    ] + list(include_files)
Exemplo n.º 11
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """

    local_ns.exclude()
    classes = []

    # ConfigNode
    ConfigNode = local_ns.class_('ConfigNode')
    ConfigNode.include()
    ConfigNode.constructors().exclude()
    classes.append(ConfigNode)

    # Event Subsystem
    EventPublisher = expose_publisher(local_ns, 'EventPublisher')    
    EventPublisher.include_files.append('core/include/EventHub.h')

    # Apply return value policy
    lookupByName = EventPublisher.member_function('lookupByName')
    lookupByName.call_policies = \
        mod_builder.call_policies.return_value_policy(
            mod_builder.call_policies.manage_new_object)
    classes.append(EventPublisher)

    QueuedEventPublisher = expose_publisher(local_ns, 'QueuedEventPublisher')
    classes.append(QueuedEventPublisher)

    # EventConnection
    EventConnection = local_ns.class_('EventConnection')
    EventConnection.include()
    EventConnection.include_files.append('core/include/EventConnection.h')
    classes.append(EventConnection)

    # IUpdatable
    IUpdatable = local_ns.class_('IUpdatable')
    IUpdatable.include()
    classes.append(IUpdatable)

    # Application
    Application = local_ns.class_('Application')
    Application.include()

    # Replace getSubsystem with one which uses our converter
    Application.member_function('getSubsystem').exclude()
    Application.add_declaration_code("""
    boost::python::object pyGetSubsystem(ram::core::Application& app,
                                         std::string subsystemName)
    {
        ram::core::SubsystemPtr subsystem = app.getSubsystem(subsystemName);
        return ram::core::SubsystemConverter::convertObject(subsystem);
    }
    """)
    Application.add_registration_code(
        'def("getSubsystem", &::pyGetSubsystem)', works_on_instance = True )
    Application.include_files.append('core/include/SubsystemConverter.h')
    
    classes.append(Application)

    # Wrap Events
    Event = local_ns.class_('Event')
    Event.include()
    classes.append(Event)

    def filterFunc(val):
        return val.name.endswith('Event') and val.name != 'Event'
    events = wrap.expose_events(local_ns, filter_func = filterFunc)
    classes += events

    # Add registrations functions for hand wrapped classes
    module_builder.add_registration_code("registerSubsystemList();")
    module_builder.add_registration_code("registerSubsystemClass();")
    module_builder.add_registration_code("registerSubsystemMakerClass();")
    module_builder.add_registration_code("registerEventHubClass();")
    module_builder.add_registration_code("registerQueuedEventHubClass();")


    # Do class wide items
    wrap.set_implicit_conversions([Application, QueuedEventPublisher,
                                   EventPublisher], False)
    wrap.add_needed_includes(classes)

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/core/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 12
0
def generate(module_builder, local_ns, global_ns):
    """
    name: is the name of the module being wrapped (in name::space::form)
    global_ns: is the module builder for the entire library
    local_ns: is the namespace that coresponds to the given namespace
    """

    # Remove all those pesky warnings about only pointed to types!
    for cls in local_ns.decls(decl_type=decls_package.class_declaration_t):
        cls.include()
        cls.already_exposed = True

    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    classes = []

    # Include IVehicle class and handle special cases
    IVehicle = local_ns.class_('IVehicle')
    IVehicle.include()
    classes.append(IVehicle)

    # Remove default wrapper for getDevice
    IVehicle.member_function('getDevice').exclude()

    # Provide the normal one by hand, so C++ users of python subclasses
    # still get the overridden method
    IVehicle.add_wrapper_code("""
    virtual ::ram::vehicle::device::IDevicePtr getDevice( ::std::string name ){
        bp::override func = this->get_override(\"getDevice\");
        return func( name);
    }
    """)

    # Provide a hand made implementation for Python users of C++ IVehicle
    # subclasses, this uses our custom converter to ensure proper IDevice
    # downcasting
    IVehicle.add_declaration_code("""
    boost::python::object pyGetDevice(
        ram::vehicle::IVehicle& veh,
        std::string deviceName)
    {
        ram::vehicle::device::IDevicePtr device =
            veh.getDevice(deviceName);
        return ram::vehicle::device::IDeviceConverter::convertObject(device);
    }
    """)
    IVehicle.add_registration_code("def(\"getDevice\", &::pyGetDevice)",
                                   works_on_instance=True)
    IVehicle.include_files.append('vehicle/include/device/IDeviceConverter.h')

    global_ns.typedef('TempNameList').type.declaration.already_exposed = True
    global_ns.typedef('TempList').include()

    # Fix TempNameList (the include does stick)
    t = global_ns.class_(
        function=lambda x: x.name.startswith('vector<std::string'))
    t.already_exposed = True

    # Fix overley long std::container names
    #wrap.mangle_container_names(local_ns)

    # Wrap Events
    events = wrap.expose_events(local_ns)
    if events:
        module_builder.class_('::ram::core::Event').already_exposed = True
        classes += events

    # Added the needed includes
    wrap.add_needed_includes(classes)
    IVehicle.include_files.append(os.environ['RAM_SVN_DIR'] +
                                  '/packages/vehicle/include/device/IDevice.h')

    # Add a castTo
    wrap.registerSubsystemConverter(IVehicle)

    module_builder.add_registration_code("registerIVehiclePtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/vehicle/include/RegisterFunctions.h'
            ] + list(include_files)