# auto-generated by x2py xpiler

from x2py.cell import MetaProperty, Cell
from x2py.event import Event

class LinkEventType(object):
    LINK_SESSION_CONNECTED = -10
    LINK_SESSION_DISCONNECTED = -11
    HANDSHAKE_REQ = -12
    HANDSHAKE_RESP = -13
    HANDSHAKE_ACK = -14

def _init_link_session_connected_tag():
    props = []
    props.append(MetaProperty('link_name', 9))
    props.append(MetaProperty('result', 1))
    props.append(MetaProperty('context', 15))
    return Event.Tag(Event.tag, 'LinkSessionConnected', props,
        LinkEventType.LINK_SESSION_CONNECTED)

class LinkSessionConnected(Event):
    tag = _init_link_session_connected_tag()

    def __init__(self, length=0):
        super(LinkSessionConnected, self).__init__(len(LinkSessionConnected.tag.props) + length)
        base = LinkSessionConnected.tag.offset
        self.values[base + 0] = ""
        self.values[base + 1] = False
        self.values[base + 2] = None

    @property
    def link_name(self):
        return self.values[LinkSessionConnected.tag.offset + 0]
    @link_name.setter
    def link_name(self, value):
        self._set_property(LinkSessionConnected.tag.offset + 0, value,
            LinkSessionConnected.tag.props[0].type_index)

    @property
    def result(self):
        return self.values[LinkSessionConnected.tag.offset + 1]
    @result.setter
    def result(self, value):
        self._set_property(LinkSessionConnected.tag.offset + 1, value,
            LinkSessionConnected.tag.props[1].type_index)

    @property
    def context(self):
        return self.values[LinkSessionConnected.tag.offset + 2]
    @context.setter
    def context(self, value):
        self._set_property(LinkSessionConnected.tag.offset + 2, value,
            LinkSessionConnected.tag.props[2].type_index)

    def type_id(self):
        return LinkSessionConnected.tag.type_id

    def type_tag(self):
        return LinkSessionConnected.tag

def _init_link_session_disconnected_tag():
    props = []
    props.append(MetaProperty('link_name', 9))
    props.append(MetaProperty('handle', 5))
    props.append(MetaProperty('context', 15))
    return Event.Tag(Event.tag, 'LinkSessionDisconnected', props,
        LinkEventType.LINK_SESSION_DISCONNECTED)

class LinkSessionDisconnected(Event):
    tag = _init_link_session_disconnected_tag()

    def __init__(self, length=0):
        super(LinkSessionDisconnected, self).__init__(len(LinkSessionDisconnected.tag.props) + length)
        base = LinkSessionDisconnected.tag.offset
        self.values[base + 0] = ""
        self.values[base + 1] = 0
        self.values[base + 2] = None

    @property
    def link_name(self):
        return self.values[LinkSessionDisconnected.tag.offset + 0]
    @link_name.setter
    def link_name(self, value):
        self._set_property(LinkSessionDisconnected.tag.offset + 0, value,
            LinkSessionDisconnected.tag.props[0].type_index)

    @property
    def handle(self):
        return self.values[LinkSessionDisconnected.tag.offset + 1]
    @handle.setter
    def handle(self, value):
        self._set_property(LinkSessionDisconnected.tag.offset + 1, value,
            LinkSessionDisconnected.tag.props[1].type_index)

    @property
    def context(self):
        return self.values[LinkSessionDisconnected.tag.offset + 2]
    @context.setter
    def context(self, value):
        self._set_property(LinkSessionDisconnected.tag.offset + 2, value,
            LinkSessionDisconnected.tag.props[2].type_index)

    def type_id(self):
        return LinkSessionDisconnected.tag.type_id

    def type_tag(self):
        return LinkSessionDisconnected.tag

def _init_handshake_req_tag():
    props = []
    props.append(MetaProperty('data', 11))
    return Event.Tag(Event.tag, 'HandshakeReq', props,
        LinkEventType.HANDSHAKE_REQ)

class HandshakeReq(Event):
    tag = _init_handshake_req_tag()

    def __init__(self, length=0):
        super(HandshakeReq, self).__init__(len(HandshakeReq.tag.props) + length)
        base = HandshakeReq.tag.offset
        self.values[base + 0] = None

    @property
    def data(self):
        return self.values[HandshakeReq.tag.offset + 0]
    @data.setter
    def data(self, value):
        self._set_property(HandshakeReq.tag.offset + 0, value,
            HandshakeReq.tag.props[0].type_index)

    def type_id(self):
        return HandshakeReq.tag.type_id

    def type_tag(self):
        return HandshakeReq.tag

def _init_handshake_resp_tag():
    props = []
    props.append(MetaProperty('data', 11))
    return Event.Tag(Event.tag, 'HandshakeResp', props,
        LinkEventType.HANDSHAKE_RESP)

class HandshakeResp(Event):
    tag = _init_handshake_resp_tag()

    def __init__(self, length=0):
        super(HandshakeResp, self).__init__(len(HandshakeResp.tag.props) + length)
        base = HandshakeResp.tag.offset
        self.values[base + 0] = None

    @property
    def data(self):
        return self.values[HandshakeResp.tag.offset + 0]
    @data.setter
    def data(self, value):
        self._set_property(HandshakeResp.tag.offset + 0, value,
            HandshakeResp.tag.props[0].type_index)

    def type_id(self):
        return HandshakeResp.tag.type_id

    def type_tag(self):
        return HandshakeResp.tag

def _init_handshake_ack_tag():
    props = []
    props.append(MetaProperty('result', 1))
    return Event.Tag(Event.tag, 'HandshakeAck', props,
        LinkEventType.HANDSHAKE_ACK)

class HandshakeAck(Event):
    tag = _init_handshake_ack_tag()

    def __init__(self, length=0):
        super(HandshakeAck, self).__init__(len(HandshakeAck.tag.props) + length)
        base = HandshakeAck.tag.offset
        self.values[base + 0] = False

    @property
    def result(self):
        return self.values[HandshakeAck.tag.offset + 0]
    @result.setter
    def result(self, value):
        self._set_property(HandshakeAck.tag.offset + 0, value,
            HandshakeAck.tag.props[0].type_index)

    def type_id(self):
        return HandshakeAck.tag.type_id

    def type_tag(self):
        return HandshakeAck.tag
