Updated wrap expected files from double clear all bug fix
parent
28eedb1940
commit
90fd122876
|
@ -15,41 +15,61 @@ static Collector_Test collector_Test;
|
||||||
|
|
||||||
void _deleteAllObjects()
|
void _deleteAllObjects()
|
||||||
{
|
{
|
||||||
|
mstream mout;
|
||||||
|
std::streambuf *outbuf = std::cout.rdbuf(&mout);
|
||||||
|
|
||||||
|
bool anyDeleted = false;
|
||||||
for(Collector_Point2::iterator iter = collector_Point2.begin();
|
for(Collector_Point2::iterator iter = collector_Point2.begin();
|
||||||
iter != collector_Point2.end(); ) {
|
iter != collector_Point2.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_Point2.erase(iter++);
|
collector_Point2.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
for(Collector_Point3::iterator iter = collector_Point3.begin();
|
for(Collector_Point3::iterator iter = collector_Point3.begin();
|
||||||
iter != collector_Point3.end(); ) {
|
iter != collector_Point3.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_Point3.erase(iter++);
|
collector_Point3.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
for(Collector_Test::iterator iter = collector_Test.begin();
|
for(Collector_Test::iterator iter = collector_Test.begin();
|
||||||
iter != collector_Test.end(); ) {
|
iter != collector_Test.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_Test.erase(iter++);
|
collector_Test.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
|
if(anyDeleted)
|
||||||
|
cout <<
|
||||||
|
"WARNING: Wrap modules with variables in the workspace have been reloaded due to\n"
|
||||||
|
"calling destructors, call 'clear all' again if you plan to now recompile a wrap\n"
|
||||||
|
"module, so that your recompiled module is used instead of the old one." << endl;
|
||||||
|
std::cout.rdbuf(outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _RTTIRegister_geometry_done = false;
|
|
||||||
void _geometry_RTTIRegister() {
|
void _geometry_RTTIRegister() {
|
||||||
std::map<std::string, std::string> types;
|
const mxArray *alreadyCreated = mexGetVariablePtr("global", "gtsam_geometry_rttiRegistry_created");
|
||||||
|
if(!alreadyCreated) {
|
||||||
|
std::map<std::string, std::string> types;
|
||||||
|
|
||||||
mxArray *registry = mexGetVariable("global", "gtsamwrap_rttiRegistry");
|
mxArray *registry = mexGetVariable("global", "gtsamwrap_rttiRegistry");
|
||||||
if(!registry)
|
if(!registry)
|
||||||
registry = mxCreateStructMatrix(1, 1, 0, NULL);
|
registry = mxCreateStructMatrix(1, 1, 0, NULL);
|
||||||
typedef std::pair<std::string, std::string> StringPair;
|
typedef std::pair<std::string, std::string> StringPair;
|
||||||
BOOST_FOREACH(const StringPair& rtti_matlab, types) {
|
BOOST_FOREACH(const StringPair& rtti_matlab, types) {
|
||||||
int fieldId = mxAddField(registry, rtti_matlab.first.c_str());
|
int fieldId = mxAddField(registry, rtti_matlab.first.c_str());
|
||||||
if(fieldId < 0)
|
if(fieldId < 0)
|
||||||
|
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
||||||
|
mxArray *matlabName = mxCreateString(rtti_matlab.second.c_str());
|
||||||
|
mxSetFieldByNumber(registry, 0, fieldId, matlabName);
|
||||||
|
}
|
||||||
|
if(mexPutVariable("global", "gtsamwrap_rttiRegistry", registry) != 0)
|
||||||
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
||||||
mxArray *matlabName = mxCreateString(rtti_matlab.second.c_str());
|
mxDestroyArray(registry);
|
||||||
mxSetFieldByNumber(registry, 0, fieldId, matlabName);
|
|
||||||
|
mxArray *newAlreadyCreated = mxCreateNumericMatrix(0, 0, mxINT8_CLASS, mxREAL);
|
||||||
|
if(mexPutVariable("global", "gtsam_geometry_rttiRegistry_created", newAlreadyCreated) != 0)
|
||||||
|
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
||||||
|
mxDestroyArray(newAlreadyCreated);
|
||||||
}
|
}
|
||||||
if(mexPutVariable("global", "gtsamwrap_rttiRegistry", registry) != 0)
|
|
||||||
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
|
||||||
mxDestroyArray(registry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Point2_collectorInsertAndMakeBase_0(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
void Point2_collectorInsertAndMakeBase_0(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
|
@ -481,10 +501,8 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
mstream mout;
|
mstream mout;
|
||||||
std::streambuf *outbuf = std::cout.rdbuf(&mout);
|
std::streambuf *outbuf = std::cout.rdbuf(&mout);
|
||||||
|
|
||||||
if(!_RTTIRegister_geometry_done) {
|
_geometry_RTTIRegister();
|
||||||
_geometry_RTTIRegister();
|
|
||||||
_RTTIRegister_geometry_done = true;
|
|
||||||
}
|
|
||||||
int id = unwrap<int>(in[0]);
|
int id = unwrap<int>(in[0]);
|
||||||
|
|
||||||
switch(id) {
|
switch(id) {
|
||||||
|
|
|
@ -25,56 +25,79 @@ static Collector_ClassD collector_ClassD;
|
||||||
|
|
||||||
void _deleteAllObjects()
|
void _deleteAllObjects()
|
||||||
{
|
{
|
||||||
|
mstream mout;
|
||||||
|
std::streambuf *outbuf = std::cout.rdbuf(&mout);
|
||||||
|
|
||||||
|
bool anyDeleted = false;
|
||||||
for(Collector_ns1ClassA::iterator iter = collector_ns1ClassA.begin();
|
for(Collector_ns1ClassA::iterator iter = collector_ns1ClassA.begin();
|
||||||
iter != collector_ns1ClassA.end(); ) {
|
iter != collector_ns1ClassA.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_ns1ClassA.erase(iter++);
|
collector_ns1ClassA.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
for(Collector_ns1ClassB::iterator iter = collector_ns1ClassB.begin();
|
for(Collector_ns1ClassB::iterator iter = collector_ns1ClassB.begin();
|
||||||
iter != collector_ns1ClassB.end(); ) {
|
iter != collector_ns1ClassB.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_ns1ClassB.erase(iter++);
|
collector_ns1ClassB.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
for(Collector_ns2ClassA::iterator iter = collector_ns2ClassA.begin();
|
for(Collector_ns2ClassA::iterator iter = collector_ns2ClassA.begin();
|
||||||
iter != collector_ns2ClassA.end(); ) {
|
iter != collector_ns2ClassA.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_ns2ClassA.erase(iter++);
|
collector_ns2ClassA.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
for(Collector_ns2ns3ClassB::iterator iter = collector_ns2ns3ClassB.begin();
|
for(Collector_ns2ns3ClassB::iterator iter = collector_ns2ns3ClassB.begin();
|
||||||
iter != collector_ns2ns3ClassB.end(); ) {
|
iter != collector_ns2ns3ClassB.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_ns2ns3ClassB.erase(iter++);
|
collector_ns2ns3ClassB.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
for(Collector_ns2ClassC::iterator iter = collector_ns2ClassC.begin();
|
for(Collector_ns2ClassC::iterator iter = collector_ns2ClassC.begin();
|
||||||
iter != collector_ns2ClassC.end(); ) {
|
iter != collector_ns2ClassC.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_ns2ClassC.erase(iter++);
|
collector_ns2ClassC.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
for(Collector_ClassD::iterator iter = collector_ClassD.begin();
|
for(Collector_ClassD::iterator iter = collector_ClassD.begin();
|
||||||
iter != collector_ClassD.end(); ) {
|
iter != collector_ClassD.end(); ) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
collector_ClassD.erase(iter++);
|
collector_ClassD.erase(iter++);
|
||||||
|
anyDeleted = true;
|
||||||
}
|
}
|
||||||
|
if(anyDeleted)
|
||||||
|
cout <<
|
||||||
|
"WARNING: Wrap modules with variables in the workspace have been reloaded due to\n"
|
||||||
|
"calling destructors, call 'clear all' again if you plan to now recompile a wrap\n"
|
||||||
|
"module, so that your recompiled module is used instead of the old one." << endl;
|
||||||
|
std::cout.rdbuf(outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _RTTIRegister_testNamespaces_done = false;
|
|
||||||
void _testNamespaces_RTTIRegister() {
|
void _testNamespaces_RTTIRegister() {
|
||||||
std::map<std::string, std::string> types;
|
const mxArray *alreadyCreated = mexGetVariablePtr("global", "gtsam_testNamespaces_rttiRegistry_created");
|
||||||
|
if(!alreadyCreated) {
|
||||||
|
std::map<std::string, std::string> types;
|
||||||
|
|
||||||
mxArray *registry = mexGetVariable("global", "gtsamwrap_rttiRegistry");
|
mxArray *registry = mexGetVariable("global", "gtsamwrap_rttiRegistry");
|
||||||
if(!registry)
|
if(!registry)
|
||||||
registry = mxCreateStructMatrix(1, 1, 0, NULL);
|
registry = mxCreateStructMatrix(1, 1, 0, NULL);
|
||||||
typedef std::pair<std::string, std::string> StringPair;
|
typedef std::pair<std::string, std::string> StringPair;
|
||||||
BOOST_FOREACH(const StringPair& rtti_matlab, types) {
|
BOOST_FOREACH(const StringPair& rtti_matlab, types) {
|
||||||
int fieldId = mxAddField(registry, rtti_matlab.first.c_str());
|
int fieldId = mxAddField(registry, rtti_matlab.first.c_str());
|
||||||
if(fieldId < 0)
|
if(fieldId < 0)
|
||||||
|
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
||||||
|
mxArray *matlabName = mxCreateString(rtti_matlab.second.c_str());
|
||||||
|
mxSetFieldByNumber(registry, 0, fieldId, matlabName);
|
||||||
|
}
|
||||||
|
if(mexPutVariable("global", "gtsamwrap_rttiRegistry", registry) != 0)
|
||||||
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
||||||
mxArray *matlabName = mxCreateString(rtti_matlab.second.c_str());
|
mxDestroyArray(registry);
|
||||||
mxSetFieldByNumber(registry, 0, fieldId, matlabName);
|
|
||||||
|
mxArray *newAlreadyCreated = mxCreateNumericMatrix(0, 0, mxINT8_CLASS, mxREAL);
|
||||||
|
if(mexPutVariable("global", "gtsam_testNamespaces_rttiRegistry_created", newAlreadyCreated) != 0)
|
||||||
|
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
||||||
|
mxDestroyArray(newAlreadyCreated);
|
||||||
}
|
}
|
||||||
if(mexPutVariable("global", "gtsamwrap_rttiRegistry", registry) != 0)
|
|
||||||
mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
|
|
||||||
mxDestroyArray(registry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ns1ClassA_collectorInsertAndMakeBase_0(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
void ns1ClassA_collectorInsertAndMakeBase_0(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
|
@ -315,10 +338,8 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
mstream mout;
|
mstream mout;
|
||||||
std::streambuf *outbuf = std::cout.rdbuf(&mout);
|
std::streambuf *outbuf = std::cout.rdbuf(&mout);
|
||||||
|
|
||||||
if(!_RTTIRegister_testNamespaces_done) {
|
_testNamespaces_RTTIRegister();
|
||||||
_testNamespaces_RTTIRegister();
|
|
||||||
_RTTIRegister_testNamespaces_done = true;
|
|
||||||
}
|
|
||||||
int id = unwrap<int>(in[0]);
|
int id = unwrap<int>(in[0]);
|
||||||
|
|
||||||
switch(id) {
|
switch(id) {
|
||||||
|
|
Loading…
Reference in New Issue