:: # Copyright 2013, Big Switch Networks, Inc.
:: #
:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
:: # the following special exception:
:: #
:: # LOXI Exception
:: #
:: # As a special exception to the terms of the EPL, you may distribute libraries
:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
:: # from the LoxiGen Libraries and the notice provided below is (i) included in
:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
:: # documentation for the LoxiGen Libraries, if distributed in binary form.
:: #
:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
:: #
:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
:: # a copy of the EPL at:
:: #
:: # http://www.eclipse.org/legal/epl-v10.html
:: #
:: # Unless required by applicable law or agreed to in writing, software
:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
:: # EPL for the specific language governing permissions and limitations
:: # under the EPL.
:: import loxi_utils.loxi_utils as loxi_utils
::
        q.text("${ofclass.pyname} {")
        with q.group():
            with q.indent(2):
                q.breakable()
:: from loxi_ir import *
:: normal_members = [m for m in ofclass.members if type(m) == OFDataMember]
:: first = True
:: for m in normal_members:
:: if not first:
                q.text(","); q.breakable()
:: else:
:: first = False
:: #endif
                q.text("${m.name} = ");
:: if m.name == "xid":
                if self.${m.name} != None:
                    q.text("%#x" % self.${m.name})
                else:
                    q.text('None')
:: elif m.oftype == 'of_mac_addr_t':
                q.text(util.pretty_mac(self.${m.name}))
:: elif m.oftype == 'of_ipv4_t':
                q.text(util.pretty_ipv4(self.${m.name}))
:: elif m.oftype == 'of_wc_bmap_t' and version in [1,2]:
                q.text(util.pretty_wildcards(self.${m.name}))
:: elif m.oftype == 'of_port_no_t':
                q.text(util.pretty_port(self.${m.name}))
:: elif loxi_utils.lookup_ir_wiretype(m.oftype, version=version).startswith("uint"):
                q.text("%#x" % self.${m.name})
:: else:
                q.pp(self.${m.name})
:: #endif
:: #endfor
            q.breakable()
        q.text('}')
