#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ===------------------------------*  Python  *------------------------------===
#             THIS FILE IS GENERATED BY INVAR. DO NOT EDIT !!!
# ===------------------------------------------------------------------------===

try:
    from cStringIO import StringIO
except:
    from StringIO import StringIO
from InvarCodec import DataWriter
from InvarCodec import DataReader

class TestXyzConflict(object):

    """"""
    CRC32_ = 0x2126E985
    SIZE_  = 9

    __slots__ = (
        '_pi',
        '_hotfix')
   #__slots__

    def __init__(self):
        self._pi     = 3.1415926
        self._hotfix = None
   #def __init__

    def __str__(self):
        s = StringIO()
        s.write(u'{')
        s.write(u' ')
        s.write(u'TestXyzConflict')
        s.write(u',')
        s.write(u' ')
        s.write(u'pi')
        s.write(u':')
        s.write(unicode(self._pi))
        s.write(u',')
        s.write(u' ')
        s.write(u'hotfix')
        s.write(u':')
        if self._hotfix is None:
            s.write(u'null')
        else:
            s.write(u'[')
            s.write(str(len(self._hotfix)))
            s.write(u']')
        s.write(u' ')
        s.write(u'}')
        result = s.getvalue()
        s.close()
        return result
   #def __str__

    def __len__(self):
        size = TestXyzConflict.SIZE_
        if self._hotfix is not None:
            size += 4
            for (k1,v1) in self._hotfix.items():
                size += len(k1)
                size += len(v1)
        return size
   #def __len__

    def read(r):
        self._pi = r.readDouble()
        hotfixExists = r.readInt8()
        if 0x01 == hotfixExists:
            if self._hotfix == None:
                self._hotfix = dict()
            lenHotfix = r.readUInt32()
            num = 0
            while num < lenHotfix:
                num += 1
                k1 = r.readString()
                v1 = r.readString()
                self._hotfix[k1] = v1
        elif 0x00 == hotfixExists:
            self._hotfix = None
        else:
            raise InvarError(498, 'Protoc read error: The value of \'hotfixExists\' is invalid.')
   #def read

    def write(w):
        w.writeDouble(self._pi)
        if self._hotfix != None:
            w.writeUInt8(0x01)
            w.writeUInt32(len(self._hotfix))
            for (k1,v1) in self._hotfix.items():
                w.writeString(k1)
                w.writeString(v1)
        else:
            w.writeUInt8(0x00)
   #def write

#class TestXyzConflict

if '__main__' == __name__:
    print('dir(TestXyzConflict()) =>\n' + '\n'.join(dir(TestXyzConflict())))
    print('TestXyzConflict.__doc__ => ' + TestXyzConflict.__doc__)
    print('TestXyzConflict.__len__ => ' + str(len(TestXyzConflict())))
    print('TestXyzConflict.__str__ => ' + str(TestXyzConflict()))

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ===------------------------------*  Python  *------------------------------===
#             THIS FILE IS GENERATED BY INVAR. DO NOT EDIT !!!
# ===------------------------------------------------------------------------===

try:
    from cStringIO import StringIO
except:
    from StringIO import StringIO
from InvarCodec import DataWriter
from InvarCodec import DataReader

class TestXyzConflict(object):

    """"""
    CRC32_ = 0x2126E985
    SIZE_  = 9

    __slots__ = (
        '_pi',
        '_hotfix')
   #__slots__

    def __init__(self):
        self._pi     = 3.1415926
        self._hotfix = None
   #def __init__

    def __str__(self):
        s = StringIO()
        s.write(u'{')
        s.write(u' ')
        s.write(u'TestXyzConflict')
        s.write(u',')
        s.write(u' ')
        s.write(u'pi')
        s.write(u':')
        s.write(unicode(self._pi))
        s.write(u',')
        s.write(u' ')
        s.write(u'hotfix')
        s.write(u':')
        if self._hotfix is None:
            s.write(u'null')
        else:
            s.write(u'[')
            s.write(str(len(self._hotfix)))
            s.write(u']')
        s.write(u' ')
        s.write(u'}')
        result = s.getvalue()
        s.close()
        return result
   #def __str__

    def __len__(self):
        size = TestXyzConflict.SIZE_
        if self._hotfix is not None:
            size += 4
            for (k1,v1) in self._hotfix.items():
                size += len(k1)
                size += len(v1)
        return size
   #def __len__

    def read(r):
        self._pi = r.readDouble()
        hotfixExists = r.readInt8()
        if 0x01 == hotfixExists:
            if self._hotfix == None:
                self._hotfix = dict()
            lenHotfix = r.readUInt32()
            num = 0
            while num < lenHotfix:
                num += 1
                k1 = r.readString()
                v1 = r.readString()
                self._hotfix[k1] = v1
        elif 0x00 == hotfixExists:
            self._hotfix = None
        else:
            raise InvarError(498, 'Protoc read error: The value of \'hotfixExists\' is invalid.')
   #def read

    def write(w):
        w.writeDouble(self._pi)
        if self._hotfix != None:
            w.writeUInt8(0x01)
            w.writeUInt32(len(self._hotfix))
            for (k1,v1) in self._hotfix.items():
                w.writeString(k1)
                w.writeString(v1)
        else:
            w.writeUInt8(0x00)
   #def write

#class TestXyzConflict

if '__main__' == __name__:
    print('dir(TestXyzConflict()) =>\n' + '\n'.join(dir(TestXyzConflict())))
    print('TestXyzConflict.__doc__ => ' + TestXyzConflict.__doc__)
    print('TestXyzConflict.__len__ => ' + str(len(TestXyzConflict())))
    print('TestXyzConflict.__str__ => ' + str(TestXyzConflict()))

#!/usr/bin/env python # -*- coding: utf-8 -*- # ===------------------------------*  Python  *------------------------------=== #             THIS FILE IS GENERATED BY INVAR. DO NOT EDIT !!! # ===------------------------------------------------------------------------=== #__slots__ #def __init__ #def __str__ #def __len__ #def read #def write #class TestXyzConflict