[gecode-users] wrapping SetVar

Kilian Sprotte ml13 at onlinehome.de
Tue Feb 6 13:21:22 CET 2007


Hi,

sorry for bothering you with a wrapping question...

I just wrapped LubRanges without problems like so:

using namespace Gecode;

// LubRanges
Gecode::Set::LubRanges<Set::SetView>* make_LubRanges(Set::SetView* v);
int LubRanges_min(Set::LubRanges<Set::SetView>* r);
int LubRanges_max(Set::LubRanges<Set::SetView>* r);
unsigned int LubRanges_width(Set::LubRanges<Set::SetView>* r);
bool LubRanges_done(Set::LubRanges<Set::SetView>* r);
void LubRanges_next(Set::LubRanges<Set::SetView>* r);
void delete_LubRanges(Set::LubRanges<Set::SetView>* r);

Now I need to create a SetView from my SetVar, in order
to access its lub with LubRanges.

using namespace Gecode;

Set::SetView* make_SetView(SetVar* set)
{
   return new Set::SetView(*set);
}

void delete_SetView(Set::SetView* v)
{
   delete v;
}

But I get the error:

/Users/paul/arch/lisp/gecol/glue.cpp: In function  
'Gecode::Set::SetView* make_SetView(Gecode::SetVar*)':
/usr/local/include/gecode/kernel/view.icc:101: error: 'static void*  
Gecode::VariableViewBase<Var>::operator new(size_t) [with Var =  
Gecode::Set::SetVarImp]' is private
/Users/paul/arch/lisp/gecol/glue.cpp:1327: error: within this context
/usr/local/include/gecode/kernel/view.icc:102: error: 'static void  
Gecode::VariableViewBase<Var>::operator delete(void*) [with Var =  
Gecode::Set::SetVarImp]' is private
/Users/paul/arch/lisp/gecol/glue.cpp:1327: error: within this context
/Users/paul/arch/lisp/gecol/glue.cpp: In function 'void delete_SetView 
(Gecode::Set::SetView*)':
/usr/local/include/gecode/kernel/view.icc:102: error: 'static void  
Gecode::VariableViewBase<Var>::operator delete(void*) [with Var =  
Gecode::Set::SetVarImp]' is private

I was hoping to be able to create a dynamic SetView and not do  
something on the stack like:

// this function could be called something like
// LubRanges_from_SetVar
{
...
SetVar* set;
SetView view(*set);
return new LubRanges ranges(view); // (this would not work I  
suppose....)
}

Because this is of course for calling things from LISP.

What do you suggest? Can I somehow override that new is private?

Best,
   Kilian






More information about the gecode-users mailing list