# Path: coolamqp/framing/base.py
# BASIC_TYPES = {u'bit': (None, None, "0", None),  # special case
#                u'octet': (1, 'B', "b'\\x00'", 1),
#                u'short': (2, 'H', "b'\\x00\\x00'", 2),
#                u'long': (4, 'I', "b'\\x00\\x00\\x00\\x00'", 4),
#                u'longlong': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'timestamp': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'table': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'longstr': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'shortstr': (None, None, "b'\\x00'", 1),  # special case
#                }
# 
# DYNAMIC_BASIC_TYPES = (u'table', u'longstr', u'shortstr')


import copy
import logging
import math
from compile_definitions.xml_fields import *
from coolamqp.framing.base import BASIC_TYPES, DYNAMIC_BASIC_TYPES
# coding=UTF-8
from __future__ import print_function, absolute_import, division



logger = logging.getLogger(__name__)


def bool_int(x):
    return bool(int(x))


__all__ = [
    'Domain', 'Method', 'Class', 'Field', 'Constant'
]


class BaseObject(object):
    FIELDS = []

    # tuples of (xml name, field name, type, (optional) default value)

    def __init__(self, elem):
        for ft in self.FIELDS:
            ft.set(self, elem)

    @classmethod
    def findall(cls, xml):
        return [cls(p) for p in xml.findall(cls.NAME)]


# Path: coolamqp/framing/base.py
# BASIC_TYPES = {u'bit': (None, None, "0", None),  # special case
#                u'octet': (1, 'B', "b'\\x00'", 1),
#                u'short': (2, 'H', "b'\\x00\\x00'", 2),
#                u'long': (4, 'I', "b'\\x00\\x00\\x00\\x00'", 4),
#                u'longlong': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'timestamp': (
#                    8, 'Q', "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'", 8),
#                u'table': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'longstr': (None, None, "b'\\x00\\x00\\x00\\x00'", 4),
#                # special case
#                u'shortstr': (None, None, "b'\\x00'", 1),  # special case
#                }
# 
# DYNAMIC_BASIC_TYPES = (u'table', u'longstr', u'shortstr')


# Path: compile_definitions/xml_tags.py
import copy
import logging
import math
from compile_definitions.xml_fields import *
from coolamqp.framing.base import BASIC_TYPES, DYNAMIC_BASIC_TYPES

# coding=UTF-8
from __future__ import print_function, absolute_import, division



logger = logging.getLogger(__name__)


def bool_int(x):
    return bool(int(x))


__all__ = [
    'Domain', 'Method', 'Class', 'Field', 'Constant'
]


class BaseObject(object):
    FIELDS = []

    # tuples of (xml name, field name, type, (optional) default value)

    def __init__(self, elem):
        for ft in self.FIELDS:
            ft.set(self, elem)

    @classmethod
    def findall(cls, xml):
        return [cls(p) for p in xml.findall(cls.NAME)]


    def _replace(self, **kwargs):