void ClassD_deconstructor_21(int nargout, mxArray *out[], int nargin, const mxArray *in[]) { typedef boost::shared_ptr<ClassD> Shared; checkArguments("delete_ClassD",nargout,nargin,1); Shared *self = *reinterpret_cast<Shared**>(mxGetData(in[0])); Collector_ClassD::iterator item; item = collector_ClassD.find(self); if(item != collector_ClassD.end()) { delete self; collector_ClassD.erase(item); } }
void _deleteAllObjects() { mstream mout; std::streambuf *outbuf = std::cout.rdbuf(&mout); bool anyDeleted = false; { for(Collector_ns1ClassA::iterator iter = collector_ns1ClassA.begin(); iter != collector_ns1ClassA.end(); ) { delete *iter; collector_ns1ClassA.erase(iter++); anyDeleted = true; } } { for(Collector_ns1ClassB::iterator iter = collector_ns1ClassB.begin(); iter != collector_ns1ClassB.end(); ) { delete *iter; collector_ns1ClassB.erase(iter++); anyDeleted = true; } } { for(Collector_ns2ClassA::iterator iter = collector_ns2ClassA.begin(); iter != collector_ns2ClassA.end(); ) { delete *iter; collector_ns2ClassA.erase(iter++); anyDeleted = true; } } { for(Collector_ns2ns3ClassB::iterator iter = collector_ns2ns3ClassB.begin(); iter != collector_ns2ns3ClassB.end(); ) { delete *iter; collector_ns2ns3ClassB.erase(iter++); anyDeleted = true; } } { for(Collector_ns2ClassC::iterator iter = collector_ns2ClassC.begin(); iter != collector_ns2ClassC.end(); ) { delete *iter; collector_ns2ClassC.erase(iter++); anyDeleted = true; } } { for(Collector_ClassD::iterator iter = collector_ClassD.begin(); iter != collector_ClassD.end(); ) { delete *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); }
void ClassD_collectorInsertAndMakeBase_19(int nargout, mxArray *out[], int nargin, const mxArray *in[]) { mexAtExit(&_deleteAllObjects); typedef boost::shared_ptr<ClassD> Shared; Shared *self = *reinterpret_cast<Shared**> (mxGetData(in[0])); collector_ClassD.insert(self); }
void ClassD_constructor_20(int nargout, mxArray *out[], int nargin, const mxArray *in[]) { mexAtExit(&_deleteAllObjects); typedef boost::shared_ptr<ClassD> Shared; Shared *self = new Shared(new ClassD()); collector_ClassD.insert(self); out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL); *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; }