/*
 * File:          sidl_EnfPolicy_Module.c
 * Symbol:        sidl.EnfPolicy-v0.9.17
 * Symbol Type:   class
 * Babel Version: 1.4.0 (Revision: 6607 release-1-4-0-branch)
 * Release:       $Name:  $
 * Revision:      @(#) $Id: $
 * Description:   implement a C extension type for a sidl extendable
 * 
 * Copyright (c) 2000-2002, Lawrence Livermore National Security, LLC.
 * Produced at the Lawrence Livermore National Laboratory.
 * Written by the Components Team <components@llnl.gov>
 * All rights reserved.
 * 
 * This file is part of Babel. For more information, see
 * http://www.llnl.gov/CASC/components/. Please read the COPYRIGHT file
 * for Our Notice and the LICENSE file for the GNU Lesser General Public
 * License.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License (as published by
 * the Free Software Foundation) version 2.1 dated February 1999.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
 * conditions of the GNU Lesser General Public License for more details.
 * 
 * You should have recieved a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 * 
 * WARNING: Automatically generated; changes will be lost
 * 
 */

/*
 * THIS CODE IS AUTOMATICALLY GENERATED BY THE BABEL
 * COMPILER. DO NOT EDIT THIS!
 * 
 * This file contains the implementation of a Python C
 * extension type (i.e. a Python type implemented in C).
 * This extension type provides Python interface to the
 * sidl type sidl.EnfPolicy.
 */


/**
 * Symbol "sidl.EnfPolicy" (version 0.9.17)
 * 
 * <code>EnfPolicy</code> maintains the current interface
 * contract enforcement policy.
 */
#include <Python.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifndef included_sidl_BaseClass_h
#include "sidl_BaseClass.h"
#endif
#ifndef included_sidl_ClassInfo_h
#include "sidl_ClassInfo.h"
#endif
#ifndef included_sidl_rmi_ProtocolFactory_h
#include "sidl_rmi_ProtocolFactory.h"
#endif
#ifndef included_sidl_rmi_InstanceRegistry_h
#include "sidl_rmi_InstanceRegistry.h"
#endif
#ifndef included_sidl_rmi_InstanceHandle_h
#include "sidl_rmi_InstanceHandle.h"
#endif
#ifndef included_sidl_rmi_Invocation_h
#include "sidl_rmi_Invocation.h"
#endif
#ifndef included_sidl_rmi_Response_h
#include "sidl_rmi_Response.h"
#endif
#ifndef included_sidl_rmi_ServerRegistry_h
#include "sidl_rmi_ServerRegistry.h"
#endif
#ifndef included_sidl_rmi_ConnectRegistry_h
#include "sidl_rmi_ConnectRegistry.h"
#endif
#ifndef included_sidl_io_Serializable_h
#include "sidl_io_Serializable.h"
#endif
#ifndef included_sidl_MemAllocException_h
#include "sidl_MemAllocException.h"
#endif
#ifndef included_sidl_NotImplementedException_h
#include "sidl_NotImplementedException.h"
#endif
#include "sidl_Exception.h"

#ifndef NULL
#define NULL 0
#endif

#include "sidl_thread.h"
#ifdef HAVE_PTHREAD
static struct sidl_recursive_mutex_t sidl_EnfPolicy__mutex= SIDL_RECURSIVE_MUTEX_INITIALIZER;
#define LOCK_STATIC_GLOBALS sidl_recursive_mutex_lock( &sidl_EnfPolicy__mutex )
#define UNLOCK_STATIC_GLOBALS sidl_recursive_mutex_unlock( &sidl_EnfPolicy__mutex )
/* #define HAVE_LOCKED_STATIC_GLOBALS (sidl_recursive_mutex_trylock( &sidl_EnfPolicy__mutex )==EDEADLOCK) */
#else
#define LOCK_STATIC_GLOBALS
#define UNLOCK_STATIC_GLOBALS
/* #define HAVE_LOCKED_STATIC_GLOBALS (1) */
#endif

#define sidl_EnfPolicy_INTERNAL 1
#include "sidl_EnfPolicy_Module.h"
#ifndef included_sidl_EnfPolicy_IOR_h
#include "sidl_EnfPolicy_IOR.h"
#endif
#include "sidlObjA.h"
#include "sidlPyArrays.h"
#ifdef SIDL_HAVE_NUMPY
#include "oldnumeric.h"
#elif defined(SIDL_HAVE_NUMERIC_PYTHON)
#include "Numeric/arrayobject.h"
#else
#error Neither Numeric Python nor NumPy installed
#endif
#ifndef included_sidl_Loader_h
#include "sidl_Loader.h"
#endif
#ifndef included_sidl_header_h
#include "sidl_header.h"
#endif
#ifndef included_sidl_String_h
#include "sidl_String.h"
#endif
#ifndef included_sidl_Python_h
#include "sidl_Python.h"
#endif
#ifndef included_sidl_interface_IOR_h
#include "sidl_interface_IOR.h"
#endif
#include "sidl_rmi_NetworkException_Module.h"
#include "sidl_BaseClass_Module.h"
#include "sidl_BaseInterface_Module.h"
#include "sidl_ClassInfo_Module.h"
#include "sidl_RuntimeException_Module.h"
#include "sidl_rmi_Call_Module.h"
#include "sidl_rmi_Return_Module.h"
#include "sidl_rmi_Ticket_Module.h"
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <stdio.h>

/*
 * lang_inited is a boolean value showing if we have already imported all the nescessary modules
 */

static int lang_inited = 0;

static void _loadDependentMods(void) {
  PyGILState_STATE _gstate;
#if (PY_VERSION_HEX >= 0x02040000)
  _gstate = PyGILState_Ensure();
  sidl_Python_LogGILEnsure(__func__, __FILE__, __LINE__, (int)_gstate);
#endif /* Python 2.4 or later */
  sidl_BaseClass__import();
  sidl_BaseInterface__import();
  sidl_ClassInfo__import();
  sidl_EnfPolicy__import();
  sidl_RuntimeException__import();
  sidl_rmi_Ticket__import();
#if (PY_VERSION_HEX >= 0x02040000)
  PyGILState_Release(_gstate);
  sidl_Python_LogGILRelease(__func__, __FILE__, __LINE__, (int)_gstate);
#endif /* Python 2.4 or later */
}

#define LANG_SPECIFIC_INIT() if(!lang_inited) { \
  lang_inited = 1; \
  _loadDependentMods(); \
}

#ifdef WITH_RMI

/**
 * RMI connector function for the class. (no addref)
 */
struct sidl_EnfPolicy__object*
sidl_EnfPolicy__connectI(const char * url, sidl_bool ar, struct               \
  sidl_BaseInterface__object **_ex);


#endif /*WITH_RMI*/

/* Static variables to hold version of IOR */
static const int32_t s_IOR_MAJOR_VERSION = 2;
static const int32_t s_IOR_MINOR_VERSION = 0;

/* Static variables for managing EPV initialization. */
static int s_remote_initialized = 0;

static struct sidl_EnfPolicy__epv s_rem_epv__sidl_enfpolicy;

static struct sidl_BaseClass__epv  s_rem_epv__sidl_baseclass;

static struct sidl_BaseInterface__epv  s_rem_epv__sidl_baseinterface;

#ifdef WITH_RMI


/* REMOTE CAST: dynamic type casting for remote objects. */
static void* remote_sidl_EnfPolicy__cast(
  struct sidl_EnfPolicy__object* self,
  const char* name, sidl_BaseInterface* _ex)
{
  int cmp;
  void* cast = NULL;
  *_ex = NULL; /* default to no exception */
  cmp = strcmp(name, "sidl.BaseInterface");
  if (!cmp) {
    (*self->d_epv->f_addRef)(self, _ex); SIDL_CHECK(*_ex);
    cast = &((*self).d_sidl_baseclass.d_sidl_baseinterface);
    return cast;
  }
  else if (cmp < 0) {
    cmp = strcmp(name, "sidl.BaseClass");
    if (!cmp) {
      (*self->d_epv->f_addRef)(self, _ex); SIDL_CHECK(*_ex);
      cast = ((struct sidl_BaseClass__object*)self);
      return cast;
    }
  }
  else if (cmp > 0) {
    cmp = strcmp(name, "sidl.EnfPolicy");
    if (!cmp) {
      (*self->d_epv->f_addRef)(self, _ex); SIDL_CHECK(*_ex);
      cast = ((struct sidl_EnfPolicy__object*)self);
      return cast;
    }
  }
  if ((*self->d_epv->f_isType)(self,name, _ex)) {
    void* (*func)(struct sidl_rmi_InstanceHandle__object*, struct             \
      sidl_BaseInterface__object**) = 
      (void* (*)(struct sidl_rmi_InstanceHandle__object*, struct              \
        sidl_BaseInterface__object**)) 
      sidl_rmi_ConnectRegistry_getConnect(name, _ex);SIDL_CHECK(*_ex);
    cast =  (*func)(((struct sidl_EnfPolicy__remote*)self->d_data)->d_ih,     \
      _ex);
  }

  return cast;
  EXIT:
  return NULL;
}

/* REMOTE DELETE: call the remote destructor for the object. */
static void remote_sidl_EnfPolicy__delete(
  struct sidl_EnfPolicy__object* self,
  struct sidl_BaseInterface__object* *_ex)
{
  *_ex = NULL;
  free((void*) self);
}

/* REMOTE GETURL: call the getURL function for the object. */
static char* remote_sidl_EnfPolicy__getURL(
  struct sidl_EnfPolicy__object* self, struct sidl_BaseInterface__object*     \
    *_ex)
{
  struct sidl_rmi_InstanceHandle__object *conn = ((struct                     \
    sidl_EnfPolicy__remote*)self->d_data)->d_ih;
  *_ex = NULL;
  if(conn != NULL) {
    return sidl_rmi_InstanceHandle_getObjectURL(conn, _ex);
  }
  return NULL;
}

/* REMOTE ADDREF: For internal babel use only! Remote addRef. */
static void remote_sidl_EnfPolicy__raddRef(
  struct sidl_EnfPolicy__object* self,struct sidl_BaseInterface__object* *_ex)
{
  struct sidl_BaseException__object* netex = NULL;
  /* initialize a new invocation */
  struct sidl_BaseInterface__object* _throwaway = NULL;
  struct sidl_rmi_InstanceHandle__object *_conn = ((struct                    \
    sidl_EnfPolicy__remote*)self->d_data)->d_ih;
  sidl_rmi_Response _rsvp = NULL;
  sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation( _conn, \
    "addRef", _ex ); SIDL_CHECK(*_ex);
  /* send actual RMI request */
  _rsvp = sidl_rmi_Invocation_invokeMethod(_inv,_ex);SIDL_CHECK(*_ex);
  /* Check for exceptions */
  netex = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);
  if(netex != NULL) {
    *_ex = (struct sidl_BaseInterface__object*)netex;
    return;
  }

  /* cleanup and return */
  EXIT:
  if(_inv) { sidl_rmi_Invocation_deleteRef(_inv,&_throwaway); }
  if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp,&_throwaway); }
  return;
}

/* REMOTE ISREMOTE: returns true if this object is Remote (it is). */
static sidl_bool
remote_sidl_EnfPolicy__isRemote(
    struct sidl_EnfPolicy__object* self, 
    struct sidl_BaseInterface__object* *_ex) {
  *_ex = NULL;
  return TRUE;
}

/* REMOTE METHOD STUB:_set_hooks */
static void
remote_sidl_EnfPolicy__set_hooks(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* in */ sidl_bool enable,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    /* initialize a new invocation */
    struct sidl_BaseInterface__object* _throwaway = NULL;
    sidl_BaseException _be = NULL;
    sidl_rmi_Response _rsvp = NULL;
    struct sidl_rmi_InstanceHandle__object * _conn = ((struct                 \
      sidl_EnfPolicy__remote*)self->d_data)->d_ih;
    sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation(      \
      _conn, "_set_hooks", _ex ); SIDL_CHECK(*_ex);

    /* pack in and inout arguments */
    sidl_rmi_Invocation_packBool( _inv, "enable", enable, _ex);SIDL_CHECK(    \
      *_ex);

    /* send actual RMI request */
    _rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);

    _be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
    if (_be != NULL) {
      struct sidl_BaseInterface__object* throwaway_exception = NULL;
      sidl_BaseException_addLine(_be, 
      "Exception unserialized from sidl.EnfPolicy._set_hooks.",
        &throwaway_exception);
      *_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast(   \
        _be,&throwaway_exception);
      goto EXIT;
    }

    /* unpack out and inout arguments */

    /* cleanup and return */
    EXIT:
    if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
    if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
    return;
  }
}

/* Contract enforcement has not been implemented for remote use. */
/* REMOTE METHOD STUB:_set_contracts */
static void
remote_sidl_EnfPolicy__set_contracts(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* in */ sidl_bool enable,
  /* in */ const char* enfFilename,
  /* in */ sidl_bool resetCounters,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    /* initialize a new invocation */
    struct sidl_BaseInterface__object* _throwaway = NULL;
    sidl_BaseException _be = NULL;
    sidl_rmi_Response _rsvp = NULL;
    struct sidl_rmi_InstanceHandle__object * _conn = ((struct                 \
      sidl_EnfPolicy__remote*)self->d_data)->d_ih;
    sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation(      \
      _conn, "_set_contracts", _ex ); SIDL_CHECK(*_ex);

    /* pack in and inout arguments */
    sidl_rmi_Invocation_packBool( _inv, "enable", enable, _ex);SIDL_CHECK(    \
      *_ex);
    sidl_rmi_Invocation_packString( _inv, "enfFilename", enfFilename,         \
      _ex);SIDL_CHECK(*_ex);
    sidl_rmi_Invocation_packBool( _inv, "resetCounters", resetCounters,       \
      _ex);SIDL_CHECK(*_ex);

    /* send actual RMI request */
    _rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);

    _be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
    if (_be != NULL) {
      struct sidl_BaseInterface__object* throwaway_exception = NULL;
      sidl_BaseException_addLine(_be, 
      "Exception unserialized from sidl.EnfPolicy._set_contracts.",
        &throwaway_exception);
      *_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast(   \
        _be,&throwaway_exception);
      goto EXIT;
    }

    /* unpack out and inout arguments */

    /* cleanup and return */
    EXIT:
    if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
    if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
    return;
  }
}

/* Contract enforcement has not been implemented for remote use. */
/* REMOTE METHOD STUB:_dump_stats */
static void
remote_sidl_EnfPolicy__dump_stats(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* in */ const char* filename,
  /* in */ const char* prefix,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    /* initialize a new invocation */
    struct sidl_BaseInterface__object* _throwaway = NULL;
    sidl_BaseException _be = NULL;
    sidl_rmi_Response _rsvp = NULL;
    struct sidl_rmi_InstanceHandle__object * _conn = ((struct                 \
      sidl_EnfPolicy__remote*)self->d_data)->d_ih;
    sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation(      \
      _conn, "_dump_stats", _ex ); SIDL_CHECK(*_ex);

    /* pack in and inout arguments */
    sidl_rmi_Invocation_packString( _inv, "filename", filename,               \
      _ex);SIDL_CHECK(*_ex);
    sidl_rmi_Invocation_packString( _inv, "prefix", prefix, _ex);SIDL_CHECK(  \
      *_ex);

    /* send actual RMI request */
    _rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);

    _be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
    if (_be != NULL) {
      struct sidl_BaseInterface__object* throwaway_exception = NULL;
      sidl_BaseException_addLine(_be, 
      "Exception unserialized from sidl.EnfPolicy._dump_stats.",
        &throwaway_exception);
      *_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast(   \
        _be,&throwaway_exception);
      goto EXIT;
    }

    /* unpack out and inout arguments */

    /* cleanup and return */
    EXIT:
    if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
    if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
    return;
  }
}

/* REMOTE EXEC: call the exec function for the object. */
static void remote_sidl_EnfPolicy__exec(
  struct sidl_EnfPolicy__object* self,const char* methodName,
  sidl_rmi_Call inArgs,
  sidl_rmi_Return outArgs,
  struct sidl_BaseInterface__object* *_ex)
{
  *_ex = NULL;
}

/* REMOTE METHOD STUB:addRef */
static void
remote_sidl_EnfPolicy_addRef(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    struct sidl_EnfPolicy__remote* r_obj = (struct                            \
      sidl_EnfPolicy__remote*)self->d_data;
    LOCK_STATIC_GLOBALS;
    r_obj->d_refcount++;
#ifdef SIDL_DEBUG_REFCOUNT
    fprintf(stderr, "babel: addRef %p new count %d (type %s)\n",
      r_obj, r_obj->d_refcount, 
      "sidl.EnfPolicy Remote Stub");
#endif /* SIDL_DEBUG_REFCOUNT */ 
    UNLOCK_STATIC_GLOBALS;
  }
}

/* REMOTE METHOD STUB:deleteRef */
static void
remote_sidl_EnfPolicy_deleteRef(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    struct sidl_EnfPolicy__remote* r_obj = (struct                            \
      sidl_EnfPolicy__remote*)self->d_data;
    LOCK_STATIC_GLOBALS;
    r_obj->d_refcount--;
#ifdef SIDL_DEBUG_REFCOUNT
    fprintf(stderr, "babel: deleteRef %p new count %d (type %s)\n",r_obj, r_obj->d_refcount, "sidl.EnfPolicy Remote Stub");
#endif /* SIDL_DEBUG_REFCOUNT */ 
    if(r_obj->d_refcount == 0) {
      sidl_rmi_InstanceHandle_deleteRef(r_obj->d_ih, _ex);
      free(r_obj);
      free(self);
    }
    UNLOCK_STATIC_GLOBALS;
  }
}

/* REMOTE METHOD STUB:isSame */
static sidl_bool
remote_sidl_EnfPolicy_isSame(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* in */ struct sidl_BaseInterface__object* iobj,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    /* initialize a new invocation */
    struct sidl_BaseInterface__object* _throwaway = NULL;
    sidl_BaseException _be = NULL;
    sidl_rmi_Response _rsvp = NULL;
    sidl_bool _retval = FALSE;
    struct sidl_rmi_InstanceHandle__object * _conn = ((struct                 \
      sidl_EnfPolicy__remote*)self->d_data)->d_ih;
    sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation(      \
      _conn, "isSame", _ex ); SIDL_CHECK(*_ex);

    /* pack in and inout arguments */
    if(iobj){
      char* _url = sidl_BaseInterface__getURL((sidl_BaseInterface)iobj,       \
        _ex);SIDL_CHECK(*_ex);
      sidl_rmi_Invocation_packString( _inv, "iobj", _url, _ex);SIDL_CHECK(    \
        *_ex);
      free((void*)_url);
    } else {
      sidl_rmi_Invocation_packString( _inv, "iobj", NULL, _ex);SIDL_CHECK(    \
        *_ex);
    }

    /* send actual RMI request */
    _rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);

    _be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
    if (_be != NULL) {
      struct sidl_BaseInterface__object* throwaway_exception = NULL;
      sidl_BaseException_addLine(_be, 
      "Exception unserialized from sidl.EnfPolicy.isSame.",
        &throwaway_exception);
      *_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast(   \
        _be,&throwaway_exception);
      goto EXIT;
    }

    /* extract return value */
    sidl_rmi_Response_unpackBool( _rsvp, "_retval", &_retval, _ex);SIDL_CHECK(\
      *_ex);

    /* unpack out and inout arguments */

    /* cleanup and return */
    EXIT:
    if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
    if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
    return _retval;
  }
}

/* REMOTE METHOD STUB:isType */
static sidl_bool
remote_sidl_EnfPolicy_isType(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* in */ const char* name,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    /* initialize a new invocation */
    struct sidl_BaseInterface__object* _throwaway = NULL;
    sidl_BaseException _be = NULL;
    sidl_rmi_Response _rsvp = NULL;
    sidl_bool _retval = FALSE;
    struct sidl_rmi_InstanceHandle__object * _conn = ((struct                 \
      sidl_EnfPolicy__remote*)self->d_data)->d_ih;
    sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation(      \
      _conn, "isType", _ex ); SIDL_CHECK(*_ex);

    /* pack in and inout arguments */
    sidl_rmi_Invocation_packString( _inv, "name", name, _ex);SIDL_CHECK(*_ex);

    /* send actual RMI request */
    _rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);

    _be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
    if (_be != NULL) {
      struct sidl_BaseInterface__object* throwaway_exception = NULL;
      sidl_BaseException_addLine(_be, 
      "Exception unserialized from sidl.EnfPolicy.isType.",
        &throwaway_exception);
      *_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast(   \
        _be,&throwaway_exception);
      goto EXIT;
    }

    /* extract return value */
    sidl_rmi_Response_unpackBool( _rsvp, "_retval", &_retval, _ex);SIDL_CHECK(\
      *_ex);

    /* unpack out and inout arguments */

    /* cleanup and return */
    EXIT:
    if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
    if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
    return _retval;
  }
}

/* REMOTE METHOD STUB:getClassInfo */
static struct sidl_ClassInfo__object*
remote_sidl_EnfPolicy_getClassInfo(
  /* in */ struct sidl_EnfPolicy__object*self ,
  /* out */ struct sidl_BaseInterface__object **_ex)
{
  LANG_SPECIFIC_INIT();
  *_ex = NULL;
  {
    /* initialize a new invocation */
    struct sidl_BaseInterface__object* _throwaway = NULL;
    sidl_BaseException _be = NULL;
    sidl_rmi_Response _rsvp = NULL;
    char*_retval_str = NULL;
    struct sidl_ClassInfo__object* _retval = 0;
    struct sidl_rmi_InstanceHandle__object * _conn = ((struct                 \
      sidl_EnfPolicy__remote*)self->d_data)->d_ih;
    sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation(      \
      _conn, "getClassInfo", _ex ); SIDL_CHECK(*_ex);

    /* pack in and inout arguments */

    /* send actual RMI request */
    _rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);

    _be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
    if (_be != NULL) {
      struct sidl_BaseInterface__object* throwaway_exception = NULL;
      sidl_BaseException_addLine(_be, 
      "Exception unserialized from sidl.EnfPolicy.getClassInfo.",
        &throwaway_exception);
      *_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast(   \
        _be,&throwaway_exception);
      goto EXIT;
    }

    /* extract return value */
    sidl_rmi_Response_unpackString( _rsvp, "_retval", &_retval_str,           \
      _ex);SIDL_CHECK(*_ex);
    _retval = sidl_ClassInfo__connectI(_retval_str, FALSE, _ex);SIDL_CHECK(   \
      *_ex);

    /* unpack out and inout arguments */

    /* cleanup and return */
    EXIT:
    if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
    if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
    return _retval;
  }
}

/* REMOTE EPV: create remote entry point vectors (EPVs). */
static void sidl_EnfPolicy__init_remote_epv(void)
{
  /* assert( HAVE_LOCKED_STATIC_GLOBALS ); */
  struct sidl_EnfPolicy__epv*     epv = &s_rem_epv__sidl_enfpolicy;
  struct sidl_BaseClass__epv*     e0  = &s_rem_epv__sidl_baseclass;
  struct sidl_BaseInterface__epv* e1  = &s_rem_epv__sidl_baseinterface;

  epv->f__cast               = remote_sidl_EnfPolicy__cast;
  epv->f__delete             = remote_sidl_EnfPolicy__delete;
  epv->f__exec               = remote_sidl_EnfPolicy__exec;
  epv->f__getURL             = remote_sidl_EnfPolicy__getURL;
  epv->f__raddRef            = remote_sidl_EnfPolicy__raddRef;
  epv->f__isRemote           = remote_sidl_EnfPolicy__isRemote;
  epv->f__set_hooks          = remote_sidl_EnfPolicy__set_hooks;
  epv->f__set_contracts      = remote_sidl_EnfPolicy__set_contracts;
  epv->f__dump_stats         = remote_sidl_EnfPolicy__dump_stats;
  epv->f__ctor               = NULL;
  epv->f__ctor2              = NULL;
  epv->f__dtor               = NULL;
  epv->f_addRef              = remote_sidl_EnfPolicy_addRef;
  epv->f_deleteRef           = remote_sidl_EnfPolicy_deleteRef;
  epv->f_isSame              = remote_sidl_EnfPolicy_isSame;
  epv->f_isType              = remote_sidl_EnfPolicy_isType;
  epv->f_getClassInfo        = remote_sidl_EnfPolicy_getClassInfo;

  e0->f__cast          = (void* (*)(struct sidl_BaseClass__object*, const     \
    char*, struct sidl_BaseInterface__object**)) epv->f__cast;
  e0->f__delete        = (void (*)(struct sidl_BaseClass__object*, struct     \
    sidl_BaseInterface__object**)) epv->f__delete;
  e0->f__getURL        = (char* (*)(struct sidl_BaseClass__object*, struct    \
    sidl_BaseInterface__object**)) epv->f__getURL;
  e0->f__raddRef       = (void (*)(struct sidl_BaseClass__object*, struct     \
    sidl_BaseInterface__object**)) epv->f__raddRef;
  e0->f__isRemote      = (sidl_bool (*)(struct sidl_BaseClass__object*,       \
    struct sidl_BaseInterface__object**)) epv->f__isRemote;
  e0->f__set_hooks     = (void (*)(struct sidl_BaseClass__object*, sidl_bool, \
    struct sidl_BaseInterface__object**)) epv->f__set_hooks;
  e0->f__set_contracts = (void (*)(struct sidl_BaseClass__object*, sidl_bool, \
    const char*, sidl_bool, struct sidl_BaseInterface__object**))             \
    epv->f__set_contracts;
  e0->f__dump_stats    = (void (*)(struct sidl_BaseClass__object*, const      \
    char*, const char*, struct sidl_BaseInterface__object**))                 \
    epv->f__dump_stats;
  e0->f__exec          = (void (*)(struct sidl_BaseClass__object*,const char*,\
    struct sidl_rmi_Call__object*,struct sidl_rmi_Return__object*,struct      \
    sidl_BaseInterface__object **)) epv->f__exec;
  e0->f_addRef         = (void (*)(struct sidl_BaseClass__object*,struct      \
    sidl_BaseInterface__object **)) epv->f_addRef;
  e0->f_deleteRef      = (void (*)(struct sidl_BaseClass__object*,struct      \
    sidl_BaseInterface__object **)) epv->f_deleteRef;
  e0->f_isSame         = (sidl_bool (*)(struct sidl_BaseClass__object*,struct \
    sidl_BaseInterface__object*,struct sidl_BaseInterface__object **))        \
    epv->f_isSame;
  e0->f_isType         = (sidl_bool (*)(struct sidl_BaseClass__object*,const  \
    char*,struct sidl_BaseInterface__object **)) epv->f_isType;
  e0->f_getClassInfo   = (struct sidl_ClassInfo__object* (*)(struct           \
    sidl_BaseClass__object*,struct sidl_BaseInterface__object **))            \
    epv->f_getClassInfo;

  e1->f__cast          = (void* (*)(void*, const char*, struct                \
    sidl_BaseInterface__object**)) epv->f__cast;
  e1->f__delete        = (void (*)(void*, struct                              \
    sidl_BaseInterface__object**)) epv->f__delete;
  e1->f__getURL        = (char* (*)(void*, struct                             \
    sidl_BaseInterface__object**)) epv->f__getURL;
  e1->f__raddRef       = (void (*)(void*, struct                              \
    sidl_BaseInterface__object**)) epv->f__raddRef;
  e1->f__isRemote      = (sidl_bool (*)(void*, struct                         \
    sidl_BaseInterface__object**)) epv->f__isRemote;
  e1->f__set_hooks     = (void (*)(void*, sidl_bool, struct                   \
    sidl_BaseInterface__object**)) epv->f__set_hooks;
  e1->f__set_contracts = (void (*)(void*, sidl_bool, const char*, sidl_bool,  \
    struct sidl_BaseInterface__object**)) epv->f__set_contracts;
  e1->f__dump_stats    = (void (*)(void*, const char*, const char*, struct    \
    sidl_BaseInterface__object**)) epv->f__dump_stats;
  e1->f__exec          = (void (*)(void*,const char*,struct                   \
    sidl_rmi_Call__object*,struct sidl_rmi_Return__object*,struct             \
    sidl_BaseInterface__object **)) epv->f__exec;
  e1->f_addRef         = (void (*)(void*,struct sidl_BaseInterface__object    \
    **)) epv->f_addRef;
  e1->f_deleteRef      = (void (*)(void*,struct sidl_BaseInterface__object    \
    **)) epv->f_deleteRef;
  e1->f_isSame         = (sidl_bool (*)(void*,struct                          \
    sidl_BaseInterface__object*,struct sidl_BaseInterface__object **))        \
    epv->f_isSame;
  e1->f_isType         = (sidl_bool (*)(void*,const char*,struct              \
    sidl_BaseInterface__object **)) epv->f_isType;
  e1->f_getClassInfo   = (struct sidl_ClassInfo__object* (*)(void*,struct     \
    sidl_BaseInterface__object **)) epv->f_getClassInfo;

  s_remote_initialized = 1;
}

/* Create an instance that connects to an existing remote object. */
static struct sidl_EnfPolicy__object*
sidl_EnfPolicy__remoteConnect(const char *url, sidl_bool ar, struct           \
  sidl_BaseInterface__object* *_ex)
{
  struct sidl_EnfPolicy__object* self = NULL;

  struct sidl_EnfPolicy__object* s0;
  struct sidl_BaseClass__object* s1;

  struct sidl_EnfPolicy__remote* r_obj = NULL;
  sidl_rmi_InstanceHandle instance = NULL;
  char* objectID = NULL;
  objectID = NULL;
  *_ex = NULL;
  if(url == NULL) {return NULL;}
  objectID = sidl_rmi_ServerRegistry_isLocalObject(url, _ex);
  if(objectID) {
    struct sidl_EnfPolicy__object* retobj = NULL;
    struct sidl_BaseInterface__object *throwaway_exception;
    sidl_BaseInterface bi = (                                                 \
      sidl_BaseInterface)sidl_rmi_InstanceRegistry_getInstanceByString(       \
      objectID, _ex); SIDL_CHECK(*_ex);
    (*bi->d_epv->f_deleteRef)(bi->d_object, &throwaway_exception);
    retobj = (struct sidl_EnfPolicy__object*) (*bi->d_epv->f__cast)(          \
      bi->d_object, "sidl.EnfPolicy", _ex);
    if(!ar) { 
      (*bi->d_epv->f_deleteRef)(bi->d_object, &throwaway_exception);
    }
    return retobj;
  }
  instance = sidl_rmi_ProtocolFactory_connectInstance(url, "sidl.EnfPolicy",  \
    ar, _ex ); SIDL_CHECK(*_ex);
  if ( instance == NULL) { return NULL; }
  self =
    (struct sidl_EnfPolicy__object*) malloc(
      sizeof(struct sidl_EnfPolicy__object));

  r_obj =
    (struct sidl_EnfPolicy__remote*) malloc(
      sizeof(struct sidl_EnfPolicy__remote));

  if(!self || !r_obj) {
    sidl_MemAllocException ex = sidl_MemAllocException_getSingletonException( \
      _ex);
    SIDL_CHECK(*_ex);
    sidl_MemAllocException_setNote(ex, "Out of memory.", _ex); SIDL_CHECK(    \
      *_ex);
    sidl_MemAllocException_add(ex, __FILE__, __LINE__,                        \
      "sidl.EnfPolicy.EPVgeneration", _ex);
    SIDL_CHECK(*_ex);
    *_ex = (struct sidl_BaseInterface__object*)ex;
    goto EXIT;
  }

  r_obj->d_refcount = 1;
  r_obj->d_ih = instance;
  s0 =                          self;
  s1 =                          &s0->d_sidl_baseclass;

  LOCK_STATIC_GLOBALS;
  if (!s_remote_initialized) {
    sidl_EnfPolicy__init_remote_epv();
  }
  UNLOCK_STATIC_GLOBALS;

  s1->d_sidl_baseinterface.d_epv    = &s_rem_epv__sidl_baseinterface;
  s1->d_sidl_baseinterface.d_object = (void*) self;

  s1->d_data = (void*) r_obj;
  s1->d_epv  = &s_rem_epv__sidl_baseclass;

  s0->d_data = (void*) r_obj;
  s0->d_epv  = &s_rem_epv__sidl_enfpolicy;

  self->d_data = (void*) r_obj;

  return self;
  EXIT:
  if(self) { free(self); }
  if(r_obj) { free(r_obj); }
  return NULL;
}
/* Create an instance that uses an already existing  */
/* InstanceHandle to connect to an existing remote object. */
static struct sidl_EnfPolicy__object*
sidl_EnfPolicy__IHConnect(sidl_rmi_InstanceHandle instance, struct            \
  sidl_BaseInterface__object* *_ex)
{
  struct sidl_EnfPolicy__object* self = NULL;

  struct sidl_EnfPolicy__object* s0;
  struct sidl_BaseClass__object* s1;

  struct sidl_EnfPolicy__remote* r_obj = NULL;
  self =
    (struct sidl_EnfPolicy__object*) malloc(
      sizeof(struct sidl_EnfPolicy__object));

  r_obj =
    (struct sidl_EnfPolicy__remote*) malloc(
      sizeof(struct sidl_EnfPolicy__remote));

  if(!self || !r_obj) {
    sidl_MemAllocException ex = sidl_MemAllocException_getSingletonException( \
      _ex);
    SIDL_CHECK(*_ex);
    sidl_MemAllocException_setNote(ex, "Out of memory.", _ex); SIDL_CHECK(    \
      *_ex);
    sidl_MemAllocException_add(ex, __FILE__, __LINE__,                        \
      "sidl.EnfPolicy.EPVgeneration", _ex);
    SIDL_CHECK(*_ex);
    *_ex = (struct sidl_BaseInterface__object*)ex;
    goto EXIT;
  }

  r_obj->d_refcount = 1;
  r_obj->d_ih = instance;
  s0 =                          self;
  s1 =                          &s0->d_sidl_baseclass;

  LOCK_STATIC_GLOBALS;
  if (!s_remote_initialized) {
    sidl_EnfPolicy__init_remote_epv();
  }
  UNLOCK_STATIC_GLOBALS;

  s1->d_sidl_baseinterface.d_epv    = &s_rem_epv__sidl_baseinterface;
  s1->d_sidl_baseinterface.d_object = (void*) self;

  s1->d_data = (void*) r_obj;
  s1->d_epv  = &s_rem_epv__sidl_baseclass;

  s0->d_data = (void*) r_obj;
  s0->d_epv  = &s_rem_epv__sidl_enfpolicy;

  self->d_data = (void*) r_obj;

  sidl_rmi_InstanceHandle_addRef(instance,_ex);SIDL_CHECK(*_ex);
  return self;
  EXIT:
  if(self) { free(self); }
  if(r_obj) { free(r_obj); }
  return NULL;
}
/* REMOTE: generate remote instance given URL string. */
static struct sidl_EnfPolicy__object*
sidl_EnfPolicy__remoteCreate(const char *url, struct                          \
  sidl_BaseInterface__object **_ex)
{
  struct sidl_BaseInterface__object* _throwaway_exception = NULL;
  struct sidl_EnfPolicy__object* self = NULL;

  struct sidl_EnfPolicy__object* s0;
  struct sidl_BaseClass__object* s1;

  struct sidl_EnfPolicy__remote* r_obj = NULL;
  sidl_rmi_InstanceHandle instance = sidl_rmi_ProtocolFactory_createInstance( \
    url, "sidl.EnfPolicy", _ex ); SIDL_CHECK(*_ex);
  if ( instance == NULL) { return NULL; }
  self =
    (struct sidl_EnfPolicy__object*) malloc(
      sizeof(struct sidl_EnfPolicy__object));

  r_obj =
    (struct sidl_EnfPolicy__remote*) malloc(
      sizeof(struct sidl_EnfPolicy__remote));

  if(!self || !r_obj) {
    sidl_MemAllocException ex = sidl_MemAllocException_getSingletonException( \
      _ex);
    SIDL_CHECK(*_ex);
    sidl_MemAllocException_setNote(ex, "Out of memory.", _ex); SIDL_CHECK(    \
      *_ex);
    sidl_MemAllocException_add(ex, __FILE__, __LINE__,                        \
      "sidl.EnfPolicy.EPVgeneration", _ex);
    SIDL_CHECK(*_ex);
    *_ex = (struct sidl_BaseInterface__object*)ex;
    goto EXIT;
  }

  r_obj->d_refcount = 1;
  r_obj->d_ih = instance;
  s0 =                          self;
  s1 =                          &s0->d_sidl_baseclass;

  LOCK_STATIC_GLOBALS;
  if (!s_remote_initialized) {
    sidl_EnfPolicy__init_remote_epv();
  }
  UNLOCK_STATIC_GLOBALS;

  s1->d_sidl_baseinterface.d_epv    = &s_rem_epv__sidl_baseinterface;
  s1->d_sidl_baseinterface.d_object = (void*) self;

  s1->d_data = (void*) r_obj;
  s1->d_epv  = &s_rem_epv__sidl_baseclass;

  s0->d_data = (void*) r_obj;
  s0->d_epv  = &s_rem_epv__sidl_enfpolicy;

  self->d_data = (void*) r_obj;

  return self;
  EXIT:
  if(instance) { sidl_rmi_InstanceHandle_deleteRef(instance,                  \
    &_throwaway_exception); }
  if(self) { free(self); }
  if(r_obj) { free(r_obj); }
  return NULL;
}
/*
 * RMI connector function for the class.
 */

struct sidl_EnfPolicy__object*
sidl_EnfPolicy__connectI(const char* url, sidl_bool ar, struct                \
  sidl_BaseInterface__object **_ex)
{
  return sidl_EnfPolicy__remoteConnect(url, ar, _ex);
}


#endif /*WITH_RMI*/
#ifdef WITH_RMI

static PyObject *
pStub_EnfPolicy__connect(PyObject *_ignored, PyObject *_args, PyObject        \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_EnfPolicy__object* self = NULL;
  char* url = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    "url",
    NULL
  };
  int _okay;
  sidl_rmi_NetworkException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "z", _kwlist,
    &url);
  if (_okay) {
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    self = sidl_EnfPolicy__remoteConnect(url,1,&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_rmi_NetworkException__object *_ex0;
      if ((_ex0 = (struct sidl_rmi_NetworkException__object *)
      sidl_PyExceptionCast(_exception, "sidl.rmi.NetworkException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_rmi_NetworkException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_rmi_NetworkException__type, _eargs);
        PyErr_SetObject(sidl_rmi_NetworkException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "O&",
        (void *)sidl_EnfPolicy__wrap, self);
    }
  }
  return _return_value;
}


#endif /*WITH_RMI*/
staticforward PyTypeObject _sidl_EnfPolicyType;

static struct sidl_EnfPolicy__sepv *_sepv = NULL;

static const struct sidl_EnfPolicy__external *_implEPV = NULL;

static PyObject *
pStub_EnfPolicy__exec(PyObject *_self, PyObject *_args, PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_EnfPolicy__object *_self_ior =
    ((struct sidl_EnfPolicy__object *)
     sidl_Cast(_self, "sidl.EnfPolicy"));
  if (_self_ior) {
    char* methodName = NULL;
    struct sidl_rmi_Call__object* inArgs = NULL;
    struct sidl_rmi_Return__object* outArgs = NULL;
    struct sidl_BaseInterface__object *_exception = NULL;
    static char *_kwlist[] = {
      "methodName",
      "inArgs",
      "outArgs",
      NULL
    };
    int _okay;
    sidl_RuntimeException__import();
    sidl_rmi_Call__import();
    sidl_rmi_Return__import();
    _okay = PyArg_ParseTupleAndKeywords(
      _args, _kwdict, 
      "zO&O&", _kwlist,
      &methodName,
      (void *)sidl_rmi_Call__convert, &inArgs,
      (void *)sidl_rmi_Return__convert, &outArgs);
    if (_okay) {
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*(_self_ior->d_epv->f__exec))(_self_ior, methodName, inArgs, outArgs,  \
        &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      if (_exception) {
        struct sidl_RuntimeException__object *_ex0;
        if ((_ex0 = (struct sidl_RuntimeException__object *)
        sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
          struct sidl_BaseInterface__object *throwaway_exception;
          PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
          PyObject *_eargs = PyTuple_New(1);
          PyTuple_SetItem(_eargs, 0, _obj);
          _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
          PyErr_SetObject(sidl_RuntimeException__type, _obj);
          Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_BEGIN_ALLOW_THREADS
          sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          (*(_exception->d_epv->f_deleteRef))(_exception->d_object,           \
            &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_END_ALLOW_THREADS
          sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          Py_XDECREF(_eargs);
        }
      }
      else {
        _return_value = Py_None;
        Py_INCREF(_return_value);
      }
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      sidl_rmi_Call_deref(inArgs);
      sidl_rmi_Return_deref(outArgs);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    }
    {
      struct sidl_BaseInterface__object *throwaway_exception;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    }
  }
  else {
    PyErr_SetString(PyExc_TypeError, 
      "self pointer is not a sidl.EnfPolicy");
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy__getURL(PyObject *_self, PyObject *_args, PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_EnfPolicy__object *_self_ior =
    ((struct sidl_EnfPolicy__object *)
     sidl_Cast(_self, "sidl.EnfPolicy"));
  if (_self_ior) {
    struct sidl_BaseInterface__object *_exception = NULL;
    static char *_kwlist[] = {
      NULL
    };
    int _okay;
    sidl_RuntimeException__import();
    _okay = PyArg_ParseTupleAndKeywords(
      _args, _kwdict, 
      "", _kwlist);
    if (_okay) {
      char* _return = NULL;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      _return = (*(_self_ior->d_epv->f__getURL))(_self_ior, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      if (_exception) {
        struct sidl_RuntimeException__object *_ex0;
        if ((_ex0 = (struct sidl_RuntimeException__object *)
        sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
          struct sidl_BaseInterface__object *throwaway_exception;
          PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
          PyObject *_eargs = PyTuple_New(1);
          PyTuple_SetItem(_eargs, 0, _obj);
          _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
          PyErr_SetObject(sidl_RuntimeException__type, _obj);
          Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_BEGIN_ALLOW_THREADS
          sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          (*(_exception->d_epv->f_deleteRef))(_exception->d_object,           \
            &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_END_ALLOW_THREADS
          sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          Py_XDECREF(_eargs);
        }
      }
      else {
        _return_value = Py_BuildValue(
          "z",
          _return);
        free((void *)_return);
      }
    }
    {
      struct sidl_BaseInterface__object *throwaway_exception;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    }
  }
  else {
    PyErr_SetString(PyExc_TypeError, 
      "self pointer is not a sidl.EnfPolicy");
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy__isLocal(PyObject *_self, PyObject *_args, PyObject *_kwdict) \
  {
  PyObject *_return_value = NULL;
  struct sidl_EnfPolicy__object *_self_ior =
    ((struct sidl_EnfPolicy__object *)
     sidl_Cast(_self, "sidl.EnfPolicy"));
  if (_self_ior) {
    struct sidl_BaseInterface__object *_exception = NULL;
    static char *_kwlist[] = {
      NULL
    };
    int _okay;
    sidl_RuntimeException__import();
    _okay = PyArg_ParseTupleAndKeywords(
      _args, _kwdict, 
      "", _kwlist);
    if (_okay) {
      sidl_bool _return = (sidl_bool) 0;
      int _proxy__return;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      _return = !(*(_self_ior->d_epv->f__isRemote))(_self_ior, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      _proxy__return = _return;
      if (_exception) {
        struct sidl_RuntimeException__object *_ex0;
        if ((_ex0 = (struct sidl_RuntimeException__object *)
        sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
          struct sidl_BaseInterface__object *throwaway_exception;
          PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
          PyObject *_eargs = PyTuple_New(1);
          PyTuple_SetItem(_eargs, 0, _obj);
          _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
          PyErr_SetObject(sidl_RuntimeException__type, _obj);
          Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_BEGIN_ALLOW_THREADS
          sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          (*(_exception->d_epv->f_deleteRef))(_exception->d_object,           \
            &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_END_ALLOW_THREADS
          sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          Py_XDECREF(_eargs);
        }
      }
      else {
        _return_value = Py_BuildValue(
          "i",
          _proxy__return);
      }
    }
    {
      struct sidl_BaseInterface__object *throwaway_exception;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    }
  }
  else {
    PyErr_SetString(PyExc_TypeError, 
      "self pointer is not a sidl.EnfPolicy");
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy__isRemote(PyObject *_self, PyObject *_args, PyObject          \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_EnfPolicy__object *_self_ior =
    ((struct sidl_EnfPolicy__object *)
     sidl_Cast(_self, "sidl.EnfPolicy"));
  if (_self_ior) {
    struct sidl_BaseInterface__object *_exception = NULL;
    static char *_kwlist[] = {
      NULL
    };
    int _okay;
    sidl_RuntimeException__import();
    _okay = PyArg_ParseTupleAndKeywords(
      _args, _kwdict, 
      "", _kwlist);
    if (_okay) {
      sidl_bool _return = (sidl_bool) 0;
      int _proxy__return;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      _return = (*(_self_ior->d_epv->f__isRemote))(_self_ior, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      _proxy__return = _return;
      if (_exception) {
        struct sidl_RuntimeException__object *_ex0;
        if ((_ex0 = (struct sidl_RuntimeException__object *)
        sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
          struct sidl_BaseInterface__object *throwaway_exception;
          PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
          PyObject *_eargs = PyTuple_New(1);
          PyTuple_SetItem(_eargs, 0, _obj);
          _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
          PyErr_SetObject(sidl_RuntimeException__type, _obj);
          Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_BEGIN_ALLOW_THREADS
          sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          (*(_exception->d_epv->f_deleteRef))(_exception->d_object,           \
            &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_END_ALLOW_THREADS
          sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          Py_XDECREF(_eargs);
        }
      }
      else {
        _return_value = Py_BuildValue(
          "i",
          _proxy__return);
      }
    }
    {
      struct sidl_BaseInterface__object *throwaway_exception;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    }
  }
  else {
    PyErr_SetString(PyExc_TypeError, 
      "self pointer is not a sidl.EnfPolicy");
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy__set_hooks(PyObject *_self, PyObject *_args, PyObject         \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_EnfPolicy__object *_self_ior =
    ((struct sidl_EnfPolicy__object *)
     sidl_Cast(_self, "sidl.EnfPolicy"));
  if (_self_ior) {
    sidl_bool enable = (sidl_bool) 0;
    struct sidl_BaseInterface__object *_exception = NULL;
    int _proxy_enable;
    static char *_kwlist[] = {
      "enable",
      NULL
    };
    int _okay;
    sidl_RuntimeException__import();
    _okay = PyArg_ParseTupleAndKeywords(
      _args, _kwdict, 
      "i", _kwlist,
      &_proxy_enable);
    if (_okay) {
      enable = (_proxy_enable ? (TRUE) : (FALSE));
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*(_self_ior->d_epv->f__set_hooks))(_self_ior, enable, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      if (_exception) {
        struct sidl_RuntimeException__object *_ex0;
        if ((_ex0 = (struct sidl_RuntimeException__object *)
        sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
          struct sidl_BaseInterface__object *throwaway_exception;
          PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
          PyObject *_eargs = PyTuple_New(1);
          PyTuple_SetItem(_eargs, 0, _obj);
          _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
          PyErr_SetObject(sidl_RuntimeException__type, _obj);
          Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_BEGIN_ALLOW_THREADS
          sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          (*(_exception->d_epv->f_deleteRef))(_exception->d_object,           \
            &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
          Py_END_ALLOW_THREADS
          sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
          Py_XDECREF(_eargs);
        }
      }
      else {
        _return_value = Py_None;
        Py_INCREF(_return_value);
      }
    }
    {
      struct sidl_BaseInterface__object *throwaway_exception;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    }
  }
  else {
    PyErr_SetString(PyExc_TypeError, 
      "self pointer is not a sidl.EnfPolicy");
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy__set_hooks_static(PyObject *_ignored, PyObject *_args,        \
  PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  sidl_bool enable = (sidl_bool) 0;
  struct sidl_BaseInterface__object *_exception = NULL;
  int _proxy_enable;
  static char *_kwlist[] = {
    "enable",
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "i", _kwlist,
    &_proxy_enable);
  if (_okay) {
    enable = (_proxy_enable ? (TRUE) : (FALSE));
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*(_sepv->f__set_hooks_static))(enable, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_None;
      Py_INCREF(_return_value);
    }
  }
  if(_implEPV) {
    _sepv = (*_implEPV->getStaticEPV)();
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_areEnforcing(PyObject *_ignored, PyObject *_args, PyObject    \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    sidl_bool _return = (sidl_bool) 0;
    int _proxy__return;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_areEnforcing))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _proxy__return = _return;
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "i",
        _proxy__return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_areTracing(PyObject *_ignored, PyObject *_args, PyObject      \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    sidl_bool _return = (sidl_bool) 0;
    int _proxy__return;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_areTracing))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _proxy__return = _return;
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "i",
        _proxy__return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_dumpStats(PyObject *_ignored, PyObject *_args, PyObject       \
  *_kwdict) {
  PyObject *_return_value = NULL;
  char* filename = NULL;
  sidl_bool header = (sidl_bool) 0;
  char* prefix = NULL;
  sidl_bool compressed = (sidl_bool) 0;
  struct sidl_BaseInterface__object *_exception = NULL;
  int _proxy_header;
  int _proxy_compressed;
  static char *_kwlist[] = {
    "filename",
    "header",
    "prefix",
    "compressed",
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "zizi", _kwlist,
    &filename,
    &_proxy_header,
    &prefix,
    &_proxy_compressed);
  if (_okay) {
    header = (_proxy_header ? (TRUE) : (FALSE));
    compressed = (_proxy_compressed ? (TRUE) : (FALSE));
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*(_sepv->f_dumpStats))(filename, header, prefix, compressed,             \
      &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_None;
      Py_INCREF(_return_value);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_endTrace(PyObject *_ignored, PyObject *_args, PyObject        \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*(_sepv->f_endTrace))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_None;
      Py_INCREF(_return_value);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getAnnealLimit(PyObject *_ignored, PyObject *_args, PyObject  \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    double _return = (double) 0;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getAnnealLimit))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "d",
        _return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getAppAvgPerCall(PyObject *_ignored, PyObject *_args,         \
  PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    double _return = (double) 0;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getAppAvgPerCall))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "d",
        _return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getContractClass(PyObject *_ignored, PyObject *_args,         \
  PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    int64_t _return = (int64_t) 0;
#ifdef HAVE_LONG_LONG
    long long int _proxy__return;
#else
    long _proxy__return;
#endif
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getContractClass))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _proxy__return = _return;
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        ""
#ifdef HAVE_LONG_LONG
        "L"
#else
        "l"
#endif
        "",
        _proxy__return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getEnforceFreq(PyObject *_ignored, PyObject *_args, PyObject  \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    int64_t _return = (int64_t) 0;
#ifdef HAVE_LONG_LONG
    long long int _proxy__return;
#else
    long _proxy__return;
#endif
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getEnforceFreq))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _proxy__return = _return;
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        ""
#ifdef HAVE_LONG_LONG
        "L"
#else
        "l"
#endif
        "",
        _proxy__return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getOverheadLimit(PyObject *_ignored, PyObject *_args,         \
  PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    double _return = (double) 0;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getOverheadLimit))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "d",
        _return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getPolicyName(PyObject *_ignored, PyObject *_args, PyObject   \
  *_kwdict) {
  PyObject *_return_value = NULL;
  sidl_bool useAbbrev = (sidl_bool) 0;
  struct sidl_BaseInterface__object *_exception = NULL;
  int _proxy_useAbbrev;
  static char *_kwlist[] = {
    "useAbbrev",
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "i", _kwlist,
    &_proxy_useAbbrev);
  if (_okay) {
    char* _return = NULL;
    useAbbrev = (_proxy_useAbbrev ? (TRUE) : (FALSE));
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getPolicyName))(useAbbrev, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "z",
        _return);
      free((void *)_return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getSamplingInterval(PyObject *_ignored, PyObject *_args,      \
  PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    int32_t _return = (int32_t) 0;
    long _proxy__return;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getSamplingInterval))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _proxy__return = _return;
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "l",
        _proxy__return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getTraceFilename(PyObject *_ignored, PyObject *_args,         \
  PyObject *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    char* _return = NULL;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getTraceFilename))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        "z",
        _return);
      free((void *)_return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_getTraceLevel(PyObject *_ignored, PyObject *_args, PyObject   \
  *_kwdict) {
  PyObject *_return_value = NULL;
  struct sidl_BaseInterface__object *_exception = NULL;
  static char *_kwlist[] = {
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "", _kwlist);
  if (_okay) {
    int64_t _return = (int64_t) 0;
#ifdef HAVE_LONG_LONG
    long long int _proxy__return;
#else
    long _proxy__return;
#endif
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _return = (*(_sepv->f_getTraceLevel))(&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    _proxy__return = _return;
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_BuildValue(
        ""
#ifdef HAVE_LONG_LONG
        "L"
#else
        "l"
#endif
        "",
        _proxy__return);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_setEnforceAll(PyObject *_ignored, PyObject *_args, PyObject   \
  *_kwdict) {
  PyObject *_return_value = NULL;
  int64_t contractClass = (int64_t) 0;
  sidl_bool clearStats = (sidl_bool) 0;
  struct sidl_BaseInterface__object *_exception = NULL;
#ifdef HAVE_LONG_LONG
  long long int _proxy_contractClass;
#else
  long _proxy_contractClass;
#endif
  int _proxy_clearStats;
  static char *_kwlist[] = {
    "contractClass",
    "clearStats",
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    ""
#ifdef HAVE_LONG_LONG
    "L"
#else
    "l"
#endif
    "i", _kwlist,
    &_proxy_contractClass,
    &_proxy_clearStats);
  if (_okay) {
    contractClass = _proxy_contractClass;
    clearStats = (_proxy_clearStats ? (TRUE) : (FALSE));
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*(_sepv->f_setEnforceAll))(contractClass, clearStats, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_None;
      Py_INCREF(_return_value);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_setEnforceNone(PyObject *_ignored, PyObject *_args, PyObject  \
  *_kwdict) {
  PyObject *_return_value = NULL;
  sidl_bool clearStats = (sidl_bool) 0;
  struct sidl_BaseInterface__object *_exception = NULL;
  int _proxy_clearStats;
  static char *_kwlist[] = {
    "clearStats",
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "i", _kwlist,
    &_proxy_clearStats);
  if (_okay) {
    clearStats = (_proxy_clearStats ? (TRUE) : (FALSE));
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*(_sepv->f_setEnforceNone))(clearStats, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_None;
      Py_INCREF(_return_value);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_setPolicy(PyObject *_ignored, PyObject *_args, PyObject       \
  *_kwdict) {
  PyObject *_return_value = NULL;
  int64_t contractClass = (int64_t) 0;
  int64_t enforceFreq = (int64_t) 0;
  int32_t interval = (int32_t) 0;
  double overheadLimit = (double) 0;
  double appAvgPerCall = (double) 0;
  double annealLimit = (double) 0;
  sidl_bool clearStats = (sidl_bool) 0;
  struct sidl_BaseInterface__object *_exception = NULL;
#ifdef HAVE_LONG_LONG
  long long int _proxy_contractClass;
#else
  long _proxy_contractClass;
#endif
#ifdef HAVE_LONG_LONG
  long long int _proxy_enforceFreq;
#else
  long _proxy_enforceFreq;
#endif
  long _proxy_interval;
  int _proxy_clearStats;
  static char *_kwlist[] = {
    "contractClass",
    "enforceFreq",
    "interval",
    "overheadLimit",
    "appAvgPerCall",
    "annealLimit",
    "clearStats",
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    ""
#ifdef HAVE_LONG_LONG
    "L"
#else
    "l"
#endif
    ""
#ifdef HAVE_LONG_LONG
    "L"
#else
    "l"
#endif
    "ldddi", _kwlist,
    &_proxy_contractClass,
    &_proxy_enforceFreq,
    &_proxy_interval,
    &overheadLimit,
    &appAvgPerCall,
    &annealLimit,
    &_proxy_clearStats);
  if (_okay) {
    contractClass = _proxy_contractClass;
    enforceFreq = _proxy_enforceFreq;
    interval = _proxy_interval;
    clearStats = (_proxy_clearStats ? (TRUE) : (FALSE));
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*(_sepv->f_setPolicy))(contractClass, enforceFreq, interval,             \
      overheadLimit, appAvgPerCall, annealLimit, clearStats, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_None;
      Py_INCREF(_return_value);
    }
  }
  return _return_value;
}

static PyObject *
pStub_EnfPolicy_startTrace(PyObject *_ignored, PyObject *_args, PyObject      \
  *_kwdict) {
  PyObject *_return_value = NULL;
  char* filename = NULL;
  int64_t traceLevel = (int64_t) 0;
  struct sidl_BaseInterface__object *_exception = NULL;
#ifdef HAVE_LONG_LONG
  long long int _proxy_traceLevel;
#else
  long _proxy_traceLevel;
#endif
  static char *_kwlist[] = {
    "filename",
    "traceLevel",
    NULL
  };
  int _okay;
  sidl_RuntimeException__import();
  _okay = PyArg_ParseTupleAndKeywords(
    _args, _kwdict, 
    "z"
#ifdef HAVE_LONG_LONG
    "L"
#else
    "l"
#endif
    "", _kwlist,
    &filename,
    &_proxy_traceLevel);
  if (_okay) {
    traceLevel = _proxy_traceLevel;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*(_sepv->f_startTrace))(filename, traceLevel, &_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    if (_exception) {
      struct sidl_RuntimeException__object *_ex0;
      if ((_ex0 = (struct sidl_RuntimeException__object *)
      sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
        struct sidl_BaseInterface__object *throwaway_exception;
        PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
        PyObject *_eargs = PyTuple_New(1);
        PyTuple_SetItem(_eargs, 0, _obj);
        _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
        PyErr_SetObject(sidl_RuntimeException__type, _obj);
        Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_BEGIN_ALLOW_THREADS
        sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        (*(_exception->d_epv->f_deleteRef))(_exception->d_object,             \
          &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
        Py_END_ALLOW_THREADS
        sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
        Py_XDECREF(_eargs);
      }
    }
    else {
      _return_value = Py_None;
      Py_INCREF(_return_value);
    }
  }
  return _return_value;
}

static int
sidl_EnfPolicy_createCast(PyObject *self, PyObject *args, PyObject *kwds) {
  struct sidl_EnfPolicy__object *optarg = NULL;
  char* url = NULL;
  PyObject * implObj = NULL;
  static char *_kwlist[] = {"sobj",  "url", "impl", NULL };
  int _okay = PyArg_ParseTupleAndKeywords(args, kwds, "|O&zO", _kwlist, (void \
    *)sidl_EnfPolicy__convert, &optarg, &url, &implObj);
  if (_okay) {
    if (!optarg && !url && !implObj) {
      struct sidl_BaseInterface__object *_exception;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      optarg = (*(_implEPV->createObject))(NULL,&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      if (_exception) {
        sidl_RuntimeException__import();
        {
          struct sidl_RuntimeException__object *_ex0;
          if ((_ex0 = (struct sidl_RuntimeException__object *)
          sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
            struct sidl_BaseInterface__object *throwaway_exception;
            PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
            PyObject *_eargs = PyTuple_New(1);
            PyTuple_SetItem(_eargs, 0, _obj);
            _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
            PyErr_SetObject(sidl_RuntimeException__type, _obj);
            Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
            Py_BEGIN_ALLOW_THREADS
            sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            (*(_exception->d_epv->f_deleteRef))(_exception->d_object,         \
              &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
            Py_END_ALLOW_THREADS
            sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            Py_XDECREF(_eargs);
          }
          return -1;
        }
      }
    }
    else if (!optarg && !url && implObj) {
      struct sidl_BaseInterface__object *_exception;
      Py_INCREF(implObj);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      optarg = (*(_implEPV->createObject))((void*)implObj,&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      if (_exception) {
        sidl_RuntimeException__import();
        {
          struct sidl_RuntimeException__object *_ex0;
          if ((_ex0 = (struct sidl_RuntimeException__object *)
          sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
            struct sidl_BaseInterface__object *throwaway_exception;
            PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
            PyObject *_eargs = PyTuple_New(1);
            PyTuple_SetItem(_eargs, 0, _obj);
            _obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
            PyErr_SetObject(sidl_RuntimeException__type, _obj);
            Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
            Py_BEGIN_ALLOW_THREADS
            sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            (*(_exception->d_epv->f_deleteRef))(_exception->d_object,         \
              &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
            Py_END_ALLOW_THREADS
            sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            Py_XDECREF(_eargs);
          }
          return -1;
        }
      }
    }

#ifdef WITH_RMI

    else if(url && !optarg && !implObj) {
      struct sidl_BaseInterface__object *_exception = NULL;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      optarg = sidl_EnfPolicy__remoteCreate(url,&_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      if (_exception) {
        sidl_rmi_NetworkException__import();
        {
          struct sidl_rmi_NetworkException__object *_ex0;
          if ((_ex0 = (struct sidl_rmi_NetworkException__object *)
          sidl_PyExceptionCast(_exception, "sidl.rmi.NetworkException"))) {
            struct sidl_BaseInterface__object *throwaway_exception;
            PyObject *_obj = sidl_rmi_NetworkException__wrap(_ex0);
            PyObject *_eargs = PyTuple_New(1);
            PyTuple_SetItem(_eargs, 0, _obj);
            _obj = PyObject_CallObject(sidl_rmi_NetworkException__type,       \
              _eargs);
            PyErr_SetObject(sidl_rmi_NetworkException__type, _obj);
            Py_XDECREF(_obj);
#if (PY_VERSION_HEX >= 0x02040000)
            Py_BEGIN_ALLOW_THREADS
            sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            (*(_exception->d_epv->f_deleteRef))(_exception->d_object,         \
              &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
            Py_END_ALLOW_THREADS
            sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            Py_XDECREF(_eargs);
          }
          }
        return -1;
      }
    }

#endif /*WITH_RMI*/

    /* OK, but fall though */
    else if(!url && optarg && !implObj) {}
    /* Error case. */
    else {
      return -1;
    }
    return sidl_Object_Init(
      (SPObject *)self,
      (struct sidl_BaseInterface__object *)optarg,
      sidl_PyStealRef);
  }
  return -1;
}

static PyMethodDef _EnfPolicyModuleMethods[] = {
  { "areEnforcing", (PyCFunction)pStub_EnfPolicy_areEnforcing,
  (METH_VARARGS | METH_KEYWORDS),
"\
areEnforcing()\n\
RETURNS\n\
   (bool _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns TRUE if contract enforcement is enabled; FALSE otherwise."
   },
  { "areTracing", (PyCFunction)pStub_EnfPolicy_areTracing,
  (METH_VARARGS | METH_KEYWORDS),
"\
areTracing()\n\
RETURNS\n\
   (bool _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns TRUE if contract enforcement tracing is enabled;\n\
FALSE otherwise."
   },
  { "dumpStats", (PyCFunction)pStub_EnfPolicy_dumpStats,
  (METH_VARARGS | METH_KEYWORDS),
"\
dumpStats( in string filename,\n\
           in bool header,\n\
           in string prefix,\n\
           in bool compressed)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Prints statistics data to the file with the specified name.\n\
The file is opened (for append) and closed on each call.\n\
\n\
@param filename   Name of the file to which the statistics\n\
data should be written.\n\
@param header     TRUE if the header line is to be printed\n\
prior to the statistics line (for compressed\n\
output only).\n\
@param prefix     String description for identifying information,\n\
if any, intended to preceed the statistics\n\
data.  Useful for distinguishing between\n\
different objects, for example.\n\
@param compressed TRUE if the enforcer state is to be dumped\n\
on a single line with semi-colon separators\n\
between fields."
   },
  { "endTrace", (PyCFunction)pStub_EnfPolicy_endTrace,
  (METH_VARARGS | METH_KEYWORDS),
"\
endTrace()\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Terminates enforcement trace file generation.  Takes a final\n\
timestamp and logs the remaining trace information."
   },
  { "getAnnealLimit", (PyCFunction)pStub_EnfPolicy_getAnnealLimit,
  (METH_VARARGS | METH_KEYWORDS),
"\
getAnnealLimit()\n\
RETURNS\n\
   (double _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the annealing limit for SIMANNEAL enforcement\n\
frequency option.  Returns 0.0 by default."
   },
  { "getAppAvgPerCall", (PyCFunction)pStub_EnfPolicy_getAppAvgPerCall,
  (METH_VARARGS | METH_KEYWORDS),
"\
getAppAvgPerCall()\n\
RETURNS\n\
   (double _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the average assumed execution time associated\n\
with the program or application.  Returns 0.0 by default."
   },
  { "getContractClass", (PyCFunction)pStub_EnfPolicy_getContractClass,
  (METH_VARARGS | METH_KEYWORDS),
"\
getContractClass()\n\
RETURNS\n\
   (sidl.ContractClass _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the contract classification policy option."
   },
  { "getEnforceFreq", (PyCFunction)pStub_EnfPolicy_getEnforceFreq,
  (METH_VARARGS | METH_KEYWORDS),
"\
getEnforceFreq()\n\
RETURNS\n\
   (sidl.EnforceFreq _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the enforcement frequency policy option."
   },
  { "getOverheadLimit", (PyCFunction)pStub_EnfPolicy_getOverheadLimit,
  (METH_VARARGS | METH_KEYWORDS),
"\
getOverheadLimit()\n\
RETURNS\n\
   (double _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the desired enforcement overhead limit for\n\
performance-driven frequency options (i.e., ADAPTFIT,\n\
ADAPTTIMING, and SIMANNEAL).  Returns 0.0 by default."
   },
  { "getPolicyName", (PyCFunction)pStub_EnfPolicy_getPolicyName,
  (METH_VARARGS | METH_KEYWORDS),
"\
getPolicyName( in bool useAbbrev)\n\
RETURNS\n\
   (string _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the name, or description, of the enforcement policy.\n\
The caller is responsible for calling sidl_String_free()\n\
on the name when done with it.\n\
\n\
@param useAbbrev   TRUE if the abbreviated name is to be\n\
returned."
   },
  { "getSamplingInterval", (PyCFunction)pStub_EnfPolicy_getSamplingInterval,
  (METH_VARARGS | METH_KEYWORDS),
"\
getSamplingInterval()\n\
RETURNS\n\
   (int _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the interval for PERIODIC (i.e., the interval) or\n\
RANDOM (i.e., the maximum random number).  Returns 0 by default."
   },
  { "getTraceFilename", (PyCFunction)pStub_EnfPolicy_getTraceFilename,
  (METH_VARARGS | METH_KEYWORDS),
"\
getTraceFilename()\n\
RETURNS\n\
   (string _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the name of the trace file.  If one was not provided,\n\
the default name is returned."
   },
  { "getTraceLevel", (PyCFunction)pStub_EnfPolicy_getTraceLevel,
  (METH_VARARGS | METH_KEYWORDS),
"\
getTraceLevel()\n\
RETURNS\n\
   (sidl.EnfTraceLevel _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Returns the level of enforcement tracing."
   },
  { "setEnforceAll", (PyCFunction)pStub_EnfPolicy_setEnforceAll,
  (METH_VARARGS | METH_KEYWORDS),
"\
setEnforceAll( in sidl.ContractClass contractClass,\n\
               in bool clearStats)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Sets the enforcement policy to always check the specified\n\
type(s) of contracts.  This is equivalent to calling\n\
setPolicy() with ALWAYS as the enforcement frequency\n\
and the specified (or default) contract class.\n\
\n\
@param contractClass  Contract classification\n\
[Default = ALLCLASSES]\n\
@param clearStats      TRUE if enforcement statistics are to be\n\
cleared; FALSE otherwise."
   },
  { "setEnforceNone", (PyCFunction)pStub_EnfPolicy_setEnforceNone,
  (METH_VARARGS | METH_KEYWORDS),
"\
setEnforceNone( in bool clearStats)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Sets the policy options to disable all contract enforcement.\n\
This is equivalent to calling setPolicy() with NEVER as the\n\
enforcement frequency.\n\
\n\
@param clearStats  TRUE if enforcement statistics are to be\n\
cleared; FALSE otherwise."
   },
  { "setPolicy", (PyCFunction)pStub_EnfPolicy_setPolicy,
  (METH_VARARGS | METH_KEYWORDS),
"\
setPolicy( in sidl.ContractClass contractClass,\n\
           in sidl.EnforceFreq enforceFreq,\n\
           in int interval,\n\
           in double overheadLimit,\n\
           in double appAvgPerCall,\n\
           in double annealLimit,\n\
           in bool clearStats)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Sets enforcement policy and options.  This method should be\n\
invoked directly to avoid the default enforcement behavior.\n\
\n\
@param contractClass  Contract classification\n\
[Default = ALLCLASSES]\n\
@param enforceFreq    Enforcement frequency\n\
[Default = ALWAYS]\n\
@param interval       Sampling interval representing the\n\
period (for PERIODIC) or maximum\n\
random number/window (for RANDOM)\n\
[Default = 0 if negative specified]\n\
@param overheadLimit  Limit on performance overhead [0.0 .. 1.0)\n\
[Default = 0.0 (or 0%) if negative]\n\
@param appAvgPerCall  Average extra, application-specific\n\
execution time, normalized by calls\n\
to annotated methods\n\
[Default = 0.0 if negative]\n\
@param annealLimit    Limit on simulated annealing function\n\
to ensure its termination\n\
(0.0 .. 2.72]\n\
[Default = 2.72 if negative specified]\n\
@param clearStats      TRUE if enforcement statistics are to be\n\
cleared; FALSE otherwise."
   },
  { "startTrace", (PyCFunction)pStub_EnfPolicy_startTrace,
  (METH_VARARGS | METH_KEYWORDS),
"\
startTrace( in string filename,\n\
            in sidl.EnfTraceLevel traceLevel)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Starts enforcement trace file generation.\n\
\n\
@param filename    Name of the destination trace file.\n\
@param traceLevel  Level of trace timing and reporting required.\n\
[Default = NONE]"
   },

#ifdef WITH_RMI

  { "_connect", (PyCFunction)pStub_EnfPolicy__connect,
  (METH_VARARGS | METH_KEYWORDS),
"\
_connect( in string url)\n\
RETURNS\n\
   ( out sidl.EnfPolicy self)\n\
RAISES\n\
    sidl.rmi.NetworkException\n\
"
   },

#endif /*WITH_RMI*/

  { "_set_hooks_static", (PyCFunction)pStub_EnfPolicy__set_hooks_static,
  (METH_VARARGS | METH_KEYWORDS),
"\
_set_hooks_static( in bool enable)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Static Method to enable/disable method hooks invocation."
   },
  { NULL, NULL }
};

static PyMethodDef _EnfPolicyObjectMethods[] = {
  { "_exec", (PyCFunction)pStub_EnfPolicy__exec,
  (METH_VARARGS | METH_KEYWORDS),
"\
_exec( in string methodName,\n\
       in sidl.rmi.Call inArgs,\n\
       in sidl.rmi.Return outArgs)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Select and execute a method by name"
   },
  { "_getURL", (PyCFunction)pStub_EnfPolicy__getURL,
  (METH_VARARGS | METH_KEYWORDS),
"\
_getURL()\n\
RETURNS\n\
   (string _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Get the URL of the Implementation of this object (for RMI)"
   },
  { "_isLocal", (PyCFunction)pStub_EnfPolicy__isLocal,
  (METH_VARARGS | METH_KEYWORDS),
"\
_isLocal()\n\
RETURNS\n\
   (bool _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
TRUE if this object is local, false if remote"
   },
  { "_isRemote", (PyCFunction)pStub_EnfPolicy__isRemote,
  (METH_VARARGS | METH_KEYWORDS),
"\
_isRemote()\n\
RETURNS\n\
   (bool _return)\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
TRUE if this object is remote, false if local"
   },
  { "_set_hooks", (PyCFunction)pStub_EnfPolicy__set_hooks,
  (METH_VARARGS | METH_KEYWORDS),
"\
_set_hooks( in bool enable)\n\
RETURNS\n\
    None\n\
RAISES\n\
    sidl.RuntimeException\n\
\n\
\
Method to enable/disable method hooks invocation."
   },
  { NULL, NULL }
};

static PyTypeObject _sidl_EnfPolicyType = {
  PyObject_HEAD_INIT(NULL)
  0,      /* ob_size */
  "sidl.EnfPolicy.EnfPolicy", /* tp_name */
  0,      /* tp_basicsize */
  0,      /* tp_itemsize */
  0,      /* tp_dealloc */
  0,      /* tp_print */
  0,      /* tp_getattr */
  0,      /* tp_setattr */
  0,      /* tp_compare */
  0,      /* tp_repr */
  0,      /* tp_as_number */
  0,      /* tp_as_sequence */
  0,      /* tp_as_mapping */
  0,      /* tp_hash  */
  0,      /* tp_call */
  0,      /* tp_str */
  0,      /* tp_getattro */
  0,      /* tp_setattro */
  0,      /* tp_as_buffer */
  Py_TPFLAGS_DEFAULT, /* tp_flags */
  "\
\
<code>EnfPolicy</code> maintains the current interface\n\
contract enforcement policy.", /* tp_doc */
  0,      /* tp_traverse */
  0,       /* tp_clear */
  0,       /* tp_richcompare */
  0,       /* tp_weaklistoffset */
  0,       /* tp_iter */
  0,       /* tp_iternext */
  _EnfPolicyObjectMethods, /* tp_methods */
  0,       /* tp_members */
  0,       /* tp_getset */
  0,       /* tp_base */
  0,       /* tp_dict */
  0,       /* tp_descr_get */
  0,       /* tp_descr_set */
  0,       /* tp_dictoffset */
  sidl_EnfPolicy_createCast,   /* tp_init */
  0,       /* tp_alloc */
  0,       /* tp_new */
};

sidl_EnfPolicy__wrap_RETURN
sidl_EnfPolicy__wrap sidl_EnfPolicy__wrap_PROTO {
  PyObject *result;
  if (sidlobj) {
    result = _sidl_EnfPolicyType.tp_new(&_sidl_EnfPolicyType, NULL, NULL);
    if (result) {
      if (sidl_Object_Init(
        (SPObject *)result,
        (struct sidl_BaseInterface__object *)(sidlobj),
        sidl_PyStealRef))
      {
        Py_DECREF(result);
        result = NULL;
      }
    }
  }
  else {
    result = Py_None;
    Py_INCREF(result);
  }
  return result;
}

sidl_EnfPolicy__weakRef_RETURN
sidl_EnfPolicy__weakRef sidl_EnfPolicy__weakRef_PROTO {
  PyObject *result;
  if (sidlobj) {
    result = _sidl_EnfPolicyType.tp_new(&_sidl_EnfPolicyType, NULL, NULL);
    if (result) {
      if (sidl_Object_Init(
        (SPObject *)result,
        (struct sidl_BaseInterface__object *)(sidlobj),
        sidl_PyWeakRef))
      {
        Py_DECREF(result);
        result = NULL;
      }
    }
  }
  else {
    result = Py_None;
    Py_INCREF(result);
  }
  return result;
}

sidl_EnfPolicy_deref_RETURN
sidl_EnfPolicy_deref sidl_EnfPolicy_deref_PROTO {
  if (sidlobj) {
    struct sidl_BaseInterface__object *throwaway_exception;
    (*(sidlobj->d_epv->f_deleteRef))(sidlobj, &throwaway_exception);
  }
}

sidl_EnfPolicy__newRef_RETURN
sidl_EnfPolicy__newRef sidl_EnfPolicy__newRef_PROTO {
  PyObject *result;
  if (sidlobj) {
    result = _sidl_EnfPolicyType.tp_new(&_sidl_EnfPolicyType, NULL, NULL);
    if (result) {
      if (sidl_Object_Init(
        (SPObject *)result,
        (struct sidl_BaseInterface__object *)(sidlobj),
        sidl_PyNewRef))
      {
        Py_DECREF(result);
        result = NULL;
      }
    }
  }
  else {
    result = Py_None;
    Py_INCREF(result);
  }
  return result;
}

sidl_EnfPolicy__addRef_RETURN
sidl_EnfPolicy__addRef sidl_EnfPolicy__addRef_PROTO {
  if (sidlobj) {
    struct sidl_BaseInterface__object *throwaway_exception;
    (*(sidlobj->d_epv->f_addRef))(sidlobj, &throwaway_exception);
  }
}

sidl_EnfPolicy_PyType_RETURN
sidl_EnfPolicy_PyType sidl_EnfPolicy_PyType_PROTO {
  Py_INCREF(&_sidl_EnfPolicyType);
  return &_sidl_EnfPolicyType;
}

sidl_EnfPolicy__convert_RETURN
sidl_EnfPolicy__convert sidl_EnfPolicy__convert_PROTO {
  if (*sidlobj) {
    struct sidl_BaseInterface__object *throwaway_exception;
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    (*((*sidlobj)->d_epv->f_deleteRef))((*sidlobj), &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
  }
  *sidlobj = sidl_Cast(obj, "sidl.EnfPolicy");
  if ((!(*sidlobj)) && (obj != Py_None)) {
    PyErr_SetString(PyExc_TypeError, 
      "argument is not a(n) sidl.EnfPolicy");
    return 0;
  }
  return 1;
}

static int
_convertPython(void *sidlarray, const int *ind, PyObject *pyobj)
{
  struct sidl_EnfPolicy__object *sidlobj = NULL;
  if (sidl_EnfPolicy__convert(pyobj, &sidlobj)) {
    sidl_interface__array_set((struct sidl_interface__array *)sidlarray,
    ind, (struct sidl_BaseInterface__object *)sidlobj);
    if (sidlobj) {
      struct sidl_BaseInterface__object *asInt = (struct                      \
        sidl_BaseInterface__object *)sidlobj;
      struct sidl_BaseInterface__object *throwaway_exception;
#if (PY_VERSION_HEX >= 0x02040000)
      Py_BEGIN_ALLOW_THREADS
      sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
      (*asInt->d_epv->f_deleteRef)(asInt->d_object, &throwaway_exception);
#if (PY_VERSION_HEX >= 0x02040000)
      Py_END_ALLOW_THREADS
      sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    }
    return FALSE;
  }
  return TRUE;
}

sidl_EnfPolicy__convert_python_array_RETURN
sidl_EnfPolicy__convert_python_array                                          \
  sidl_EnfPolicy__convert_python_array_PROTO {
  int result = 0;
  if (*sidlarray) {
#if (PY_VERSION_HEX >= 0x02040000)
    Py_BEGIN_ALLOW_THREADS
    sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    sidl__array_deleteRef((struct sidl__array *)*sidlarray);
#if (PY_VERSION_HEX >= 0x02040000)
    Py_END_ALLOW_THREADS
    sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
    *sidlarray = NULL;
  }
  if (obj == Py_None) {
    result = TRUE;
  }
  else {
    PyObject *pya = PyArray_FromObject(obj, PyArray_OBJECT, 0, 0);
    if (pya) {
      if (PyArray_OBJECT == ((PyArrayObject *)pya)->descr->type_num) {
        int dimen, lower[SIDL_MAX_ARRAY_DIMENSION],
          upper[SIDL_MAX_ARRAY_DIMENSION],
          stride[SIDL_MAX_ARRAY_DIMENSION];
        if (sidl_array__extract_python_info
          (pya, &dimen, lower, upper, stride))
        {
            *sidlarray = (struct                                              \
              sidl_EnfPolicy__array*)sidl_interface__array_createRow
            (dimen, lower, upper);
          result = sidl_array__convert_python
            (pya, dimen, *sidlarray, _convertPython);
          if (*sidlarray && !result) {
#if (PY_VERSION_HEX >= 0x02040000)
            Py_BEGIN_ALLOW_THREADS
            sidl_Python_LogUnlock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            sidl_interface__array_deleteRef(
              (struct  sidl_interface__array *)*sidlarray);
#if (PY_VERSION_HEX >= 0x02040000)
            Py_END_ALLOW_THREADS
            sidl_Python_LogRelock(__func__, __FILE__, __LINE__);
#endif /* Python 2.4 or later */
            *sidlarray = NULL;
          }
        }
      }
      Py_DECREF(pya);
    }
  }
  return result;
}

static int
_convertSIDL(void *sidlarray, const int *ind, PyObject **dest)
{
  struct sidl_EnfPolicy__object *sidlobj = (struct sidl_EnfPolicy__object*)
  sidl_interface__array_get((struct sidl_interface__array *)
    sidlarray, ind);
  *dest = sidl_EnfPolicy__wrap(sidlobj);
  return (*dest == NULL);
}

sidl_EnfPolicy__convert_sidl_array_RETURN
sidl_EnfPolicy__convert_sidl_array sidl_EnfPolicy__convert_sidl_array_PROTO {
  PyObject *pya = NULL;
  if (sidlarray) {
    const int dimen = sidlArrayDim(sidlarray);
    int numelem[7];
    int32_t start[7];
#if SIZEOF_INT != 4
    int lower[7];
    int upper[7];
    int32_t s_numelem[7];
#else
    int * const lower = (int *)(sidlarray->d_lower);
    int * const upper = (int *)(sidlarray->d_upper);
    int32_t * const s_numelem = numelem;
#endif
    int i;
    for(i = 0; i < dimen; ++i) {
      start[i] = sidlLower(sidlarray, i);
#if SIZEOF_INT != 4
      lower[i] = sidlLower(sidlarray, i);
      upper[i] = sidlUpper(sidlarray, i);
      s_numelem[i] = sidlLength(sidlarray, i);
#endif
      numelem[i] = 1 + upper[i] - lower[i];
    }
    pya = PyArray_FromDims(dimen, numelem, PyArray_OBJECT);
    if (pya) {
      if (!sidl_array__convert_sidl(pya, dimen, start,
        sidlarray->d_upper,
        s_numelem, sidlarray, _convertSIDL))
      {
        Py_DECREF(pya);
        pya = NULL;
      }
    }
  }
  else {
    Py_INCREF(Py_None);
    pya = Py_None;
  }
  return pya;
}

void
initEnfPolicy(void) {
  PyObject *module, *dict, *c_api;
  static void *ExternalAPI[sidl_EnfPolicy__API_NUM];
  struct sidl_BaseInterface__object *throwaway_exception;
  module = Py_InitModule3("EnfPolicy", _EnfPolicyModuleMethods, "\
\
<code>EnfPolicy</code> maintains the current interface\n\
contract enforcement policy."
  );
  dict = PyModule_GetDict(module);
  ExternalAPI[sidl_EnfPolicy__wrap_NUM] = (void*)sidl_EnfPolicy__wrap;
  ExternalAPI[sidl_EnfPolicy__convert_NUM] = (void*)sidl_EnfPolicy__convert;
  ExternalAPI[sidl_EnfPolicy__convert_python_array_NUM] = (                   \
    void*)sidl_EnfPolicy__convert_python_array;
  ExternalAPI[sidl_EnfPolicy__convert_sidl_array_NUM] = (                     \
    void*)sidl_EnfPolicy__convert_sidl_array;
  ExternalAPI[sidl_EnfPolicy__weakRef_NUM] = (void*)sidl_EnfPolicy__weakRef;
  ExternalAPI[sidl_EnfPolicy_deref_NUM] = (void*)sidl_EnfPolicy_deref;
  ExternalAPI[sidl_EnfPolicy__newRef_NUM] = (void*)sidl_EnfPolicy__newRef;
  ExternalAPI[sidl_EnfPolicy__addRef_NUM] = (void*)sidl_EnfPolicy__addRef;
  ExternalAPI[sidl_EnfPolicy_PyType_NUM] = (void*)sidl_EnfPolicy_PyType;
#ifdef WITH_RMI
  ExternalAPI[sidl_EnfPolicy__connectI_NUM] = (void*)sidl_EnfPolicy__connectI;
#endif /*WITH_RMI*/
  import_SIDLObjA();
  if (PyErr_Occurred()) {
    Py_FatalError("Error importing sidlObjA module.");
  }
  c_api = PyCObject_FromVoidPtr((void *)ExternalAPI, NULL);
  PyDict_SetItemString(dict, "_C_API", c_api);
  Py_XDECREF(c_api);
  import_SIDLPyArrays();
  if (PyErr_Occurred()) {
    Py_FatalError("Error importing sidlPyArrays module.");
  }
  import_array();
  if (PyErr_Occurred()) {
    Py_FatalError("Error importing Numeric Python module.");
  }
  sidl_BaseClass__import();
  _sidl_EnfPolicyType.tp_base = sidl_BaseClass_PyType();
  _sidl_EnfPolicyType.tp_bases = PyTuple_New(1);
  PyTuple_SetItem(_sidl_EnfPolicyType.tp_bases,0, (PyObject                   \
    *)sidl_BaseClass_PyType());
  if (PyType_Ready(&_sidl_EnfPolicyType) < 0) {
    PyErr_Print();
    fprintf(stderr, "PyType_Ready on sidl.EnfPolicy failed.\n");
    return;
  }
  Py_INCREF(&_sidl_EnfPolicyType);
  PyDict_SetItemString(dict, "EnfPolicy", (PyObject *)&_sidl_EnfPolicyType);
  _implEPV = sidl_EnfPolicy__externals();
  _sepv = (*_implEPV->getStaticEPV)();
  if (PyErr_Occurred()) {
    Py_FatalError("Cannot initialize Python module sidl.EnfPolicy.");
  }

#ifdef WITH_RMI


  sidl_rmi_ConnectRegistry_registerConnect("sidl.EnfPolicy", (                \
    void*)sidl_EnfPolicy__IHConnect, &throwaway_exception);

#endif /*WITH_RMI*/

}
