# 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




class GdbBaseParameter(gdb.Parameter, object):
    def __init__(self, name, command, param, sequence=None):
        if param == gdb.PARAM_ENUM:
            gdb.Parameter.__init__(self, name, command, param, sequence)
        else:
            gdb.Parameter.__init__(self, name, command, param)

    def get_value(self):
        return self.value

    def get_set_string(self):
        return str(self.value)

    def get_show_string(self, value):
        return value


class GdbParameterFactory(object):
    def create_enum_parameter(self, parameter_type):
        class GdbParameterEnum(GdbBaseParameter, parameter_type):
            __doc__ = parameter_type.__doc__
            show_doc = __doc__
            set_doc = __doc__

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

# 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





class GdbBaseParameter(gdb.Parameter, object):
    def __init__(self, name, command, param, sequence=None):
        if param == gdb.PARAM_ENUM:
            gdb.Parameter.__init__(self, name, command, param, sequence)
        else:
            gdb.Parameter.__init__(self, name, command, param)

    def get_value(self):
        return self.value

    def get_set_string(self):
        return str(self.value)

    def get_show_string(self, value):
        return value


class GdbParameterFactory(object):
    def create_enum_parameter(self, parameter_type):
        class GdbParameterEnum(GdbBaseParameter, parameter_type):
            __doc__ = parameter_type.__doc__
            show_doc = __doc__
            set_doc = __doc__

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

                gdb_name = parameter_type.name().replace(' ', '-')