# Path: voidwalker/framework/interface/parameter.py
# class BooleanParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class EnumParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @abc.abstractmethod
#     def sequence(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class IntegerParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class Parameter(object):
#     __metaclass__ = abc.ABCMeta
# 
#     def init(self):
#         pass
# 
#     @staticmethod
#     def name():
#         raise NotImplementedError
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class PrefixParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @classmethod
#     def get_value(cls):
#         raise TypeError
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError


import gdb
from ...framework.interface.parameter import BooleanParameter
from ...framework.interface.parameter import EnumParameter
from ...framework.interface.parameter import IntegerParameter
from ...framework.interface.parameter import Parameter
from ...framework.interface.parameter import PrefixParameter
                parameter_type.__init__(self)
                gdb_name = parameter_type.name().replace(' ', '-')
                GdbBaseParameter.__init__(self, gdb_name,
                                          gdb.COMMAND_SUPPORT,
                                          gdb.PARAM_BOOLEAN)
                self.value = parameter_type.default_value(self)

        return GdbParameterBoolean()

    def create_generic_parameter(self, parameter_type):
        class GdbParameter(parameter_type):
            __doc__ = parameter_type.__doc__

            def __init__(self):
                parameter_type.__init__(self)

        return GdbParameter()

    def create(self, parameter_type):
        create_method = [(EnumParameter, self.create_enum_parameter),
                         (IntegerParameter, self.create_integer_parameter),
                         (BooleanParameter, self.create_boolean_parameter),
                         (PrefixParameter, self.create_generic_parameter),
                         (Parameter, self.create_generic_parameter)]
        for ptype, create in create_method:
            if issubclass(parameter_type, ptype):
                return create(parameter_type)

        else:
            raise TypeError('Parameter %s of type %s unknown!' %

# Path: voidwalker/framework/interface/parameter.py
# class BooleanParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class EnumParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @abc.abstractmethod
#     def sequence(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class IntegerParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class Parameter(object):
#     __metaclass__ = abc.ABCMeta
# 
#     def init(self):
#         pass
# 
#     @staticmethod
#     def name():
#         raise NotImplementedError
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError
# 
# Path: voidwalker/framework/interface/parameter.py
# class PrefixParameter(Parameter):
#     __metaclass__ = abc.ABCMeta
# 
#     @classmethod
#     def get_value(cls):
#         raise TypeError
# 
#     @abc.abstractmethod
#     def default_value(self):
#         raise NotImplementedError


# Path: voidwalker/backends/gdb/parameter.py
import gdb
from ...framework.interface.parameter import BooleanParameter
from ...framework.interface.parameter import EnumParameter
from ...framework.interface.parameter import IntegerParameter
from ...framework.interface.parameter import Parameter
from ...framework.interface.parameter import PrefixParameter

                parameter_type.__init__(self)
                gdb_name = parameter_type.name().replace(' ', '-')
                GdbBaseParameter.__init__(self, gdb_name,
                                          gdb.COMMAND_SUPPORT,
                                          gdb.PARAM_BOOLEAN)
                self.value = parameter_type.default_value(self)

        return GdbParameterBoolean()

    def create_generic_parameter(self, parameter_type):
        class GdbParameter(parameter_type):
            __doc__ = parameter_type.__doc__

            def __init__(self):
                parameter_type.__init__(self)

        return GdbParameter()

    def create(self, parameter_type):
        create_method = [(EnumParameter, self.create_enum_parameter),
                         (IntegerParameter, self.create_integer_parameter),
                         (BooleanParameter, self.create_boolean_parameter),
                         (PrefixParameter, self.create_generic_parameter),
                         (Parameter, self.create_generic_parameter)]
        for ptype, create in create_method:
            if issubclass(parameter_type, ptype):
                return create(parameter_type)

        else:
            raise TypeError('Parameter %s of type %s unknown!' %

                            parameter_type.name(), str(type(parameter_type)))