coriolis/hurricane/src/isobar/PyUpdateSession.cpp

103 lines
2.8 KiB
C++
Raw Normal View History

2008-03-06 10:46:43 -06:00
// -*- C++ -*-
//
// 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
#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" {
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(UpdateSession,session,function)
2008-03-06 10:46:43 -06:00
// x=================================================================x
// | "PyUpdateSession" Python Module Code Part |
2008-03-06 10:46:43 -06:00
// x=================================================================x
#if defined(__PYTHON_MODULE__)
static void PyUpdateSession_DeAlloc ( PyUpdateSession* self )
{
cdebug.log(20) << "PyUpdateSession_DeAlloc(" << hex << self << ")" << endl;
}
2008-03-06 10:46:43 -06:00
static PyObject* PyUpdateSession_open ( PyObject* )
{
cdebug.log(20) << "PyUpdateSession_open()" << endl;
2008-03-06 10:46:43 -06:00
HTRY
UpdateSession::open ();
2008-03-06 10:46:43 -06:00
HCATCH
Py_RETURN_NONE;
}
2008-03-06 10:46:43 -06:00
static PyObject* PyUpdateSession_close ( PyObject* )
2008-03-06 10:46:43 -06:00
{
cdebug.log(20) << "PyUpdateSession_close()" << endl;
2008-03-06 10:46:43 -06:00
HTRY
UpdateSession::close ();
2008-03-06 10:46:43 -06:00
HCATCH
Py_RETURN_NONE;
}
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
// | "PyUpdateSession" Shared Library Code Part |
2008-03-06 10:46:43 -06:00
// x=================================================================x
PyTypeObjectDefinitions(UpdateSession)
2008-03-06 10:46:43 -06:00
# endif // End of Shared Library Code Part.
2008-03-06 10:46:43 -06:00
} // End of extern "C".
2008-03-06 10:46:43 -06:00
} // End of Isobar namespace.