Exemplo n.º 1
0
            def __get__(fget_self, obj, cls=None):
                if cls is None:
                    if obj is None:
                        return fget_self
                    else:
                        cls = obj.__class__

                if cls._binary is None:
                    raise ValueError('_binary was not specified.')

                # Create a binary object
                binary = find_binary(cls._binary, cls._srv_check)

                # Create the function object
                func = binary[identifier].make_function(
                    convention, args, return_type)

                # Called with a this pointer?
                if obj is not None:
                    # Wrap the function using MemberFunction, so we don't have
                    # to pass the this pointer anymore
                    func = MemberFunction(self, return_type, func, obj)

                func.__doc__ = doc
                return func
Exemplo n.º 2
0
        def __get__(fget_self, obj, cls):
            # Create the function object
            func = ptr.make_function(convention, args, return_type)

            # Called with a this pointer?
            if obj is not None:
                # Wrap the function using MemberFunction, so we don't have
                # to pass the this pointer anymore
                func = MemberFunction(self, return_type, func, obj)

            func.__doc__ = doc
            return func
Exemplo n.º 3
0
        def fget(ptr):
            """Return the virtual function."""
            # Create the virtual function
            func = ptr.make_virtual_function(index, convention, args,
                                             return_type)

            # Wrap it using MemberFunction, so we don't have to pass the this
            # pointer anymore
            return MemberFunction(self, return_type, func, ptr)
Exemplo n.º 4
0
            def __get__(fget_self, obj, cls):
                if cls._binary is None:
                    raise ValueError('_binary was not specified.')

                # Create a binary object
                binary = find_binary(cls._binary, cls._srv_check)

                # Create the function object
                func = binary[identifier].make_function(
                    convention,
                    args,
                    return_type
                )

                # Called with a this pointer?
                if obj is not None:
                    # Wrap the function using MemberFunction, so we don't have
                    # to pass the this pointer anymore
                    func = MemberFunction(self, return_type, func, obj)

                func.__doc__ = doc
                return func