# Path: core/ezdxf/tools/binarydata.py
# def compress_binary_data(tags):
#     dxftype = tags.dxftype()
#     for subclass in tags.subclasses[1:]:
#         if not subclass:  # empty subclass AcDbVertex
#             continue  # todo: why is subclass AcDbVertex empty, should contain DXFTag(100, 'AcDbVertex')
#             # but it works, output DXF contains all necessary subclasses
#         name = subclass[0].value
#         if name == 'AcDbEntity' and dxftype in ENTITIES_WITH_PROXY_GRAPHIC:
#             # 310: proxy entity graphics data
#             _compress_binary_tags(subclass)
#         if name in SUBCLASSES_WITH_BINARY_DATA:
#             # 310: binary object data
#             _compress_binary_tags(subclass)
# 
# Path: core/ezdxf/tools/handle.py
# class HandleGenerator(object):
#     def __init__(self, start_value='1'):
#         self._handle = int(start_value, 16)
#     reset = __init__
# 
#     def __str__(self):
#         return "%X" % self._handle
# 
#     def next(self):
#         next_handle = self.__str__()
#         self._handle += 1
#         return next_handle
#     __next__ = next


from .tools.binarydata import compress_binary_data
from .tools.handle import HandleGenerator
# Created: 11.03.2011
# Copyright (C) 2011, Manfred Moitzi
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"



def factory():
    return EntityDB()


class EntityDB(object):
    """ A simple key/value database a.k.a. dict(), but can be replaced other
    classes that implements all of the methods of `EntityDB`. The entities
    have no order.

    The Data Model

    Every entity/object, except tables and sections, are represented as
    tag-list (see Tags Class), this lists are stored in the drawing-associated
    database, database-key is the 'handle' tag (code == 5 or 105).

    For the entity/object manipulation this tag-list will be wrapped into
    separated classes, which are generated by the dxffactory-object.
    The dxffactory-object generates DXF-Version specific wrapper classes.

    """
    def __init__(self):
        self._database = {}

# Path: core/ezdxf/tools/binarydata.py
# def compress_binary_data(tags):
#     dxftype = tags.dxftype()
#     for subclass in tags.subclasses[1:]:
#         if not subclass:  # empty subclass AcDbVertex
#             continue  # todo: why is subclass AcDbVertex empty, should contain DXFTag(100, 'AcDbVertex')
#             # but it works, output DXF contains all necessary subclasses
#         name = subclass[0].value
#         if name == 'AcDbEntity' and dxftype in ENTITIES_WITH_PROXY_GRAPHIC:
#             # 310: proxy entity graphics data
#             _compress_binary_tags(subclass)
#         if name in SUBCLASSES_WITH_BINARY_DATA:
#             # 310: binary object data
#             _compress_binary_tags(subclass)
# 
# Path: core/ezdxf/tools/handle.py
# class HandleGenerator(object):
#     def __init__(self, start_value='1'):
#         self._handle = int(start_value, 16)
#     reset = __init__
# 
#     def __str__(self):
#         return "%X" % self._handle
# 
#     def next(self):
#         next_handle = self.__str__()
#         self._handle += 1
#         return next_handle
#     __next__ = next


# Path: core/ezdxf/database.py
from .tools.binarydata import compress_binary_data
from .tools.handle import HandleGenerator

# Created: 11.03.2011
# Copyright (C) 2011, Manfred Moitzi
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"



def factory():
    return EntityDB()


class EntityDB(object):
    """ A simple key/value database a.k.a. dict(), but can be replaced other
    classes that implements all of the methods of `EntityDB`. The entities
    have no order.

    The Data Model

    Every entity/object, except tables and sections, are represented as
    tag-list (see Tags Class), this lists are stored in the drawing-associated
    database, database-key is the 'handle' tag (code == 5 or 105).

    For the entity/object manipulation this tag-list will be wrapped into
    separated classes, which are generated by the dxffactory-object.
    The dxffactory-object generates DXF-Version specific wrapper classes.

    """
    def __init__(self):
        self._database = {}

        self.handles = HandleGenerator()