# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************
#
# Ice version 3.4.2
#
# <auto-generated>
#
# Generated from file `Current.ice'
#
# Warning: do not edit this file.
#
# </auto-generated>
#

import Ice, IcePy, __builtin__
import Ice_ObjectAdapterF_ice
import Ice_ConnectionF_ice
import Ice_Identity_ice

# Included module Ice
_M_Ice = Ice.openModule('Ice')

# Start of module Ice
__name__ = 'Ice'

if not _M_Ice.__dict__.has_key('_t_Context'):
    _M_Ice._t_Context = IcePy.defineDictionary('::Ice::Context', (), IcePy._t_string, IcePy._t_string)

if not _M_Ice.__dict__.has_key('OperationMode'):
    _M_Ice.OperationMode = Ice.createTempClass()
    class OperationMode(object):
        '''The OperationMode determines the retry behavior an
invocation in case of a (potentially) recoverable error.'''

        def __init__(self, val):
            assert(val >= 0 and val < 3)
            self.value = val

        def __str__(self):
            return self._names[self.value]

        __repr__ = __str__

        def __hash__(self):
            return self.value

        def __lt__(self, other):
            if isinstance(other, _M_Ice.OperationMode):
                return self.value < other.value;
            elif other == None:
                return False
            return NotImplemented

        def __le__(self, other):
            if isinstance(other, _M_Ice.OperationMode):
                return self.value <= other.value;
            elif other == None:
                return False
            return NotImplemented

        def __eq__(self, other):
            if isinstance(other, _M_Ice.OperationMode):
                return self.value == other.value;
            elif other == None:
                return False
            return NotImplemented

        def __ne__(self, other):
            if isinstance(other, _M_Ice.OperationMode):
                return self.value != other.value;
            elif other == None:
                return False
            return NotImplemented

        def __gt__(self, other):
            if isinstance(other, _M_Ice.OperationMode):
                return self.value > other.value;
            elif other == None:
                return False
            return NotImplemented

        def __ge__(self, other):
            if isinstance(other, _M_Ice.OperationMode):
                return self.value >= other.value;
            elif other == None:
                return False
            return NotImplemented

        _names = ('Normal', 'Nonmutating', 'Idempotent')

    OperationMode.Normal = OperationMode(0)
    OperationMode.Nonmutating = OperationMode(1)
    OperationMode.Idempotent = OperationMode(2)

    _M_Ice._t_OperationMode = IcePy.defineEnum('::Ice::OperationMode', OperationMode, (), (OperationMode.Normal, OperationMode.Nonmutating, OperationMode.Idempotent))

    _M_Ice.OperationMode = OperationMode
    del OperationMode

if not _M_Ice.__dict__.has_key('Current'):
    _M_Ice.Current = Ice.createTempClass()
    class Current(object):
        '''Information about the current method invocation for servers. Each
operation on the server has a Current as its implicit final
parameter. Current is mostly used for Ice services. Most
applications ignore this parameter.'''
        def __init__(self, adapter=None, con=None, id=Ice._struct_marker, facet='', operation='', mode=_M_Ice.OperationMode.Normal, ctx=None, requestId=0):
            self.adapter = adapter
            self.con = con
            if id is Ice._struct_marker:
                self.id = _M_Ice.Identity()
            else:
                self.id = id
            self.facet = facet
            self.operation = operation
            self.mode = mode
            self.ctx = ctx
            self.requestId = requestId

        def __hash__(self):
            _h = 0
            _h = 5 * _h + __builtin__.hash(self.adapter)
            _h = 5 * _h + __builtin__.hash(self.con)
            _h = 5 * _h + __builtin__.hash(self.id)
            _h = 5 * _h + __builtin__.hash(self.facet)
            _h = 5 * _h + __builtin__.hash(self.operation)
            _h = 5 * _h + __builtin__.hash(self.mode)
            if self.ctx:
                for _i0 in self.ctx:
                    _h = 5 * _h + __builtin__.hash(_i0)
                    _h = 5 * _h + __builtin__.hash(self.ctx[_i0])
            _h = 5 * _h + __builtin__.hash(self.requestId)
            return _h % 0x7fffffff

        def __lt__(self, other):
            if isinstance(other, _M_Ice.Current):
                return self.adapter < other.adapter or self.con < other.con or self.id < other.id or self.facet < other.facet or self.operation < other.operation or self.mode < other.mode or self.ctx < other.ctx or self.requestId < other.requestId
            elif other == None:
                return False
            return NotImplemented

        def __le__(self, other):
            if isinstance(other, _M_Ice.Current):
                return self.adapter <= other.adapter or self.con <= other.con or self.id <= other.id or self.facet <= other.facet or self.operation <= other.operation or self.mode <= other.mode or self.ctx <= other.ctx or self.requestId <= other.requestId
            elif other == None:
                return False
            return NotImplemented

        def __eq__(self, other):
            if isinstance(other, _M_Ice.Current):
                return self.adapter == other.adapter and self.con == other.con and self.id == other.id and self.facet == other.facet and self.operation == other.operation and self.mode == other.mode and self.ctx == other.ctx and self.requestId == other.requestId
            elif other == None:
                return False
            return NotImplemented

        def __ne__(self, other):
            if isinstance(other, _M_Ice.Current):
                return self.adapter != other.adapter or self.con != other.con or self.id != other.id or self.facet != other.facet or self.operation != other.operation or self.mode != other.mode or self.ctx != other.ctx or self.requestId != other.requestId
            elif other == None:
                return True
            return NotImplemented

        def __gt__(self, other):
            if isinstance(other, _M_Ice.Current):
                return self.adapter > other.adapter or self.con > other.con or self.id > other.id or self.facet > other.facet or self.operation > other.operation or self.mode > other.mode or self.ctx > other.ctx or self.requestId > other.requestId
            elif other == None:
                return False
            return NotImplemented

        def __ge__(self, other):
            if isinstance(other, _M_Ice.Current):
                return self.adapter >= other.adapter or self.con >= other.con or self.id >= other.id or self.facet >= other.facet or self.operation >= other.operation or self.mode >= other.mode or self.ctx >= other.ctx or self.requestId >= other.requestId
            elif other == None:
                return False
            return NotImplemented

        def __str__(self):
            return IcePy.stringify(self, _M_Ice._t_Current)

        __repr__ = __str__

    _M_Ice._t_Current = IcePy.defineStruct('::Ice::Current', Current, (), (
        ('adapter', (), _M_Ice._t_ObjectAdapter),
        ('con', (), _M_Ice._t_Connection),
        ('id', (), _M_Ice._t_Identity),
        ('facet', (), IcePy._t_string),
        ('operation', (), IcePy._t_string),
        ('mode', (), _M_Ice._t_OperationMode),
        ('ctx', (), _M_Ice._t_Context),
        ('requestId', (), IcePy._t_int)
    ))

    _M_Ice.Current = Current
    del Current

# End of module Ice
