# Path: glitter/utils/dtypes.py
# class Datatype(object):
#     def __init__(self, integer, signed, nptype, _gltype=None, charcode=None):
#     def from_numpy(cls, nptype):
#     def _from_gl(cls, _gltype):
#     def as_numpy(self):
#     def _as_gl(self):
#     def as_signed(self):
#     def as_unsigned(self):
#     def as_nbytes(self, nbytes):
#     def is_signed(self):
#     def is_unsigned(self):
#     def is_integer(self):
#     def is_float(self):
#     def is_boolean(self):
#     def charcode(self):
#     def nbytes(self):
#     def __str__(self):
#     def __repr__(self):
#     def coerced(self, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# def coerce_array(data, dtype=None, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# 
# Path: glitter/utils/objects.py
# def with_obj(obj, f):
#     """Create a wrapper that executes C{f} in a C{with obj:} block."""
#     @_wraps(f)
#     def wrapper(*args, **kwargs):
#         with obj:
#             return f(*args, **kwargs)
#     return wrapper


from inspect import getmembers as _getmembers
from glitter.utils.dtypes import coerce_array, int32
from glitter.utils.objects import with_obj
import types as _types
import numpy as _np
import glitter.raw as _gl
import collections
"""Base classes for descriptors and descriptor owners.

@bug: L{Proxy} is currently unaware of its context.
@author: Stephan Wenger
@date: 2012-02-29
"""



class Proxy(object):
    def __init__(self, getter=None, get_args=(), setter=None, set_args=(), dtype=None, shape=(), enum=None, name=None):
        self._getter = getter
        self._get_args = get_args
        self._setter = setter
        self._set_args = set_args

# Path: glitter/utils/dtypes.py
# class Datatype(object):
#     def __init__(self, integer, signed, nptype, _gltype=None, charcode=None):
#     def from_numpy(cls, nptype):
#     def _from_gl(cls, _gltype):
#     def as_numpy(self):
#     def _as_gl(self):
#     def as_signed(self):
#     def as_unsigned(self):
#     def as_nbytes(self, nbytes):
#     def is_signed(self):
#     def is_unsigned(self):
#     def is_integer(self):
#     def is_float(self):
#     def is_boolean(self):
#     def charcode(self):
#     def nbytes(self):
#     def __str__(self):
#     def __repr__(self):
#     def coerced(self, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# def coerce_array(data, dtype=None, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# 
# Path: glitter/utils/objects.py
# def with_obj(obj, f):
#     """Create a wrapper that executes C{f} in a C{with obj:} block."""
#     @_wraps(f)
#     def wrapper(*args, **kwargs):
#         with obj:
#             return f(*args, **kwargs)
#     return wrapper


# Path: glitter/utils/proxy.py
from inspect import getmembers as _getmembers
from glitter.utils.dtypes import coerce_array, int32
from glitter.utils.objects import with_obj
import types as _types
import numpy as _np
import glitter.raw as _gl
import collections

"""Base classes for descriptors and descriptor owners.

@bug: L{Proxy} is currently unaware of its context.
@author: Stephan Wenger
@date: 2012-02-29
"""



class Proxy(object):
    def __init__(self, getter=None, get_args=(), setter=None, set_args=(), dtype=None, shape=(), enum=None, name=None):
        self._getter = getter
        self._get_args = get_args
        self._setter = setter
        self._set_args = set_args

        self._dtype = dtype if dtype else int32