2008-05-29 Guillaume SADEGH <sadegh@lrde.epita.fr>
* Makefile.am, nips.cc, nips.hh: Fix the previous patch.
This commit is contained in:
parent
a48a10e82e
commit
ff134eb81e
3 changed files with 20 additions and 7 deletions
|
|
@ -35,7 +35,7 @@ libspotnips_la_SOURCES = \
|
||||||
nips.cc
|
nips.cc
|
||||||
|
|
||||||
noinst_PROGRAMS = \
|
noinst_PROGRAMS = \
|
||||||
dottynips
|
dottynips empt_check
|
||||||
|
|
||||||
dottynips_SOURCES = dottynips.cc
|
dottynips_SOURCES = dottynips.cc
|
||||||
dottynips_LDADD = libspotnips.la $(builddir)/nips_vm/libnipsvm.la
|
dottynips_LDADD = libspotnips.la $(builddir)/nips_vm/libnipsvm.la
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "misc/hashfunc.hh"
|
#include "misc/hashfunc.hh"
|
||||||
#include "nips.hh"
|
#include "nips.hh"
|
||||||
|
#include "nipsvm.h"
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
|
|
@ -385,7 +386,8 @@ namespace spot
|
||||||
if (bytecode_ == 0)
|
if (bytecode_ == 0)
|
||||||
throw nips_exception("bytecode_load_from_file()");
|
throw nips_exception("bytecode_load_from_file()");
|
||||||
|
|
||||||
int res = nipsvm_init(&nipsvm_, bytecode_, successor_state_callback,
|
nipsvm_ = new nipsvm_t();
|
||||||
|
int res = nipsvm_init(nipsvm_, bytecode_, successor_state_callback,
|
||||||
search_error_callback);
|
search_error_callback);
|
||||||
|
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
|
|
@ -394,12 +396,21 @@ namespace spot
|
||||||
|
|
||||||
nips_interface::~nips_interface()
|
nips_interface::~nips_interface()
|
||||||
{
|
{
|
||||||
nipsvm_finalize(&nipsvm_);
|
nipsvm_finalize(nipsvm_);
|
||||||
bytecode_unload(bytecode_);
|
bytecode_unload(bytecode_);
|
||||||
|
delete nipsvm_;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool nips_interface::has_monitor() const
|
||||||
|
{
|
||||||
|
if (bytecode_ == 0)
|
||||||
|
throw nips_exception("The bytecode isn't loaded");
|
||||||
|
|
||||||
|
return bytecode_monitor_present(bytecode_);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba* nips_interface::automaton()
|
tgba* nips_interface::automaton()
|
||||||
{
|
{
|
||||||
return new tgba_nips(dict_, &nipsvm_);
|
return new tgba_nips(dict_, nipsvm_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,10 @@
|
||||||
# include "tgba/tgba.hh"
|
# include "tgba/tgba.hh"
|
||||||
# include "common.hh"
|
# include "common.hh"
|
||||||
|
|
||||||
// Damn, nipsvm.h is include, to fix.
|
|
||||||
# include "nipsvm.h"
|
|
||||||
|
|
||||||
|
// Fwd declarations.
|
||||||
|
typedef struct nipsvm_t nipsvm_t;
|
||||||
|
typedef struct t_bytecode nipsvm_bytecode_t;
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
|
|
@ -54,10 +55,11 @@ namespace spot
|
||||||
public:
|
public:
|
||||||
nips_interface(bdd_dict* dict, const std::string& filename);
|
nips_interface(bdd_dict* dict, const std::string& filename);
|
||||||
~nips_interface();
|
~nips_interface();
|
||||||
|
bool has_monitor() const;
|
||||||
tgba* automaton();
|
tgba* automaton();
|
||||||
private:
|
private:
|
||||||
bdd_dict* dict_;
|
bdd_dict* dict_;
|
||||||
nipsvm_t nipsvm_;
|
nipsvm_t* nipsvm_;
|
||||||
nipsvm_bytecode_t* bytecode_;
|
nipsvm_bytecode_t* bytecode_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue