2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
2010-07-12 10:07:58 -05:00
|
|
|
// This file is part of the Coriolis Software.
|
|
|
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
2008-03-06 10:46:43 -06:00
|
|
|
//
|
|
|
|
// x-----------------------------------------------------------------x
|
|
|
|
// | |
|
|
|
|
// | C O R I O L I S |
|
|
|
|
// | I s o b a r - Hurricane / Python Interface |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./PyUpdateSession.cpp" |
|
|
|
|
// | *************************************************************** |
|
|
|
|
// | U p d a t e s |
|
|
|
|
// | |
|
|
|
|
// x-----------------------------------------------------------------x
|
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
|
2008-05-21 17:46:29 -05:00
|
|
|
#include "hurricane/isobar/PyUpdateSession.h"
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
|
|
|
namespace Isobar {
|
|
|
|
|
2008-03-28 04:48:47 -05:00
|
|
|
using namespace Hurricane;
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(UpdateSession,session,function)
|
|
|
|
|
|
|
|
|
2008-03-06 10:46:43 -06:00
|
|
|
// x=================================================================x
|
2010-07-12 10:07:58 -05:00
|
|
|
// | "PyUpdateSession" Python Module Code Part |
|
2008-03-06 10:46:43 -06:00
|
|
|
// x=================================================================x
|
|
|
|
|
|
|
|
#if defined(__PYTHON_MODULE__)
|
|
|
|
|
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
static void PyUpdateSession_DeAlloc ( PyUpdateSession* self )
|
|
|
|
{
|
2016-05-17 16:00:06 -05:00
|
|
|
cdebug.log(20) << "PyUpdateSession_DeAlloc(" << hex << self << ")" << endl;
|
2010-07-12 10:07:58 -05:00
|
|
|
}
|
|
|
|
|
2008-03-06 10:46:43 -06:00
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
static PyObject* PyUpdateSession_open ( PyObject* )
|
|
|
|
{
|
2016-05-17 16:00:06 -05:00
|
|
|
cdebug.log(20) << "PyUpdateSession_open()" << endl;
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
HTRY
|
2008-04-14 09:31:33 -05:00
|
|
|
UpdateSession::open ();
|
2008-03-06 10:46:43 -06:00
|
|
|
HCATCH
|
|
|
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
}
|
2010-07-12 10:07:58 -05:00
|
|
|
|
2008-03-06 10:46:43 -06:00
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
static PyObject* PyUpdateSession_close ( PyObject* )
|
2008-03-06 10:46:43 -06:00
|
|
|
{
|
2016-05-17 16:00:06 -05:00
|
|
|
cdebug.log(20) << "PyUpdateSession_close()" << endl;
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
HTRY
|
2010-07-12 10:07:58 -05:00
|
|
|
UpdateSession::close ();
|
2008-03-06 10:46:43 -06:00
|
|
|
HCATCH
|
|
|
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
}
|
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
|
|
|
|
PyMethodDef PyUpdateSession_Methods[] =
|
|
|
|
{ { "open" , (PyCFunction)PyUpdateSession_open, METH_NOARGS|METH_CLASS
|
|
|
|
, "Opens a new Update Session." }
|
|
|
|
, { "close" , (PyCFunction)PyUpdateSession_close, METH_NOARGS|METH_CLASS
|
|
|
|
, "Closes an Update Session." }
|
|
|
|
, {NULL, NULL, 0, NULL} /* sentinel */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
PyTypeObjectLinkPyTypeWithoutObject(UpdateSession,UpdateSession)
|
|
|
|
|
|
|
|
|
2008-03-06 10:46:43 -06:00
|
|
|
#else // End of Python Module Code Part.
|
|
|
|
|
|
|
|
|
|
|
|
// x=================================================================x
|
2010-07-12 10:07:58 -05:00
|
|
|
// | "PyUpdateSession" Shared Library Code Part |
|
2008-03-06 10:46:43 -06:00
|
|
|
// x=================================================================x
|
|
|
|
|
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
PyTypeObjectDefinitions(UpdateSession)
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
# endif // End of Shared Library Code Part.
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
2010-07-12 10:07:58 -05:00
|
|
|
} // End of extern "C".
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
|
|
|
} // End of Isobar namespace.
|
|
|
|
|