text
stringlengths 0
2.2M
|
---|
int level = StringUtil::countOccurrences(className, "<");
|
if(className=="std::string" || className=="string")serOpt = 1;
|
else if(className=="char")serOpt = 2;
|
else if(className=="unsigned char")serOpt = 3;
|
else if(className=="int")serOpt = 4;
|
else if(className=="unsigned int")serOpt = 5;
|
else if(className=="short")serOpt = 6;
|
else if(className=="unsigned short")serOpt = 7;
|
else if(className=="long")serOpt = 8;
|
else if(className=="unsigned long")serOpt = 9;
|
else if(className=="long long")serOpt = 10;
|
else if(className=="unsigned long long")serOpt = 11;
|
else if(className=="float")serOpt = 12;
|
else if(className=="double")serOpt = 13;
|
else if(className=="long double")serOpt = 14;
|
else if(className=="bool")serOpt = 15;
|
else if(className=="Date")serOpt = 16;
|
else if(className=="BinaryData")serOpt = 17;
|
else if(level>1)
|
{
|
serOpt = 18;
|
}
|
else if(className=="std::ifstream")serOpt = 19;
|
else if(className.find("std::vector<")!=std::string::npos || className.find("vector<")!=std::string::npos ||
|
className.find("std::list<")!=std::string::npos || className.find("list<")!=std::string::npos ||
|
className.find("std::set<")!=std::string::npos || className.find("set<")!=std::string::npos ||
|
className.find("std::multiset<")!=std::string::npos || className.find("multiset<")!=std::string::npos ||
|
className.find("std::queue<")!=std::string::npos || className.find("queue<")!=std::string::npos ||
|
className.find("std::deque<")!=std::string::npos || className.find("deque<")!=std::string::npos)
|
{
|
std::string cc = className.substr(0, className.find("<"));
|
if(cc.find("std::")==0) cc = cc.substr(5);
|
std::string ic = className.substr(className.find("<")+1);
|
if(ic.find(",")!=std::string::npos) ic = ic.substr(0, ic.find(","));
|
else ic = ic.substr(0, ic.find(">"));
|
int icsO = 0;
|
if(ic=="std::string" || ic=="string")icsO = 1;
|
else if(ic=="char")icsO = 2;
|
else if(ic=="unsigned char")icsO = 3;
|
else if(ic=="int")icsO = 4;
|
else if(ic=="unsigned int")icsO = 5;
|
else if(ic=="short")icsO = 6;
|
else if(ic=="unsigned short")icsO = 7;
|
else if(ic=="long")icsO = 8;
|
else if(ic=="unsigned long")icsO = 9;
|
else if(ic=="long long")icsO = 10;
|
else if(ic=="unsigned long long")icsO = 11;
|
else if(ic=="float")icsO = 12;
|
else if(ic=="double")icsO = 13;
|
else if(ic=="long double")icsO = 14;
|
else if(ic=="bool")icsO = 15;
|
else if(ic=="Date")icsO = 16;
|
else if(ic=="BinaryData")icsO = 17;
|
else if(ic=="std::ifstream")icsO = 19;
|
if(cc=="vector") serOpt = 100 + icsO;
|
else if(cc=="list") serOpt = 200 + icsO;
|
else if(cc=="set") serOpt = 300 + icsO;
|
else if(cc=="multiset") serOpt = 400 + icsO;
|
else if(cc=="queue") serOpt = 500 + icsO;
|
else if(cc=="deque") serOpt = 600 + icsO;
|
}
|
destroy(serOpt, instance, className, app);
|
}
|
void Reflector::destroy(int serOpt, void* instance, std::string className, const std::string& app) {
|
std::string appName = CommonUtils::getAppName(app);
|
switch(serOpt) {
|
case 0: {
|
ClassInfo* ci = getClassInfo(className, app);
|
if(ci->getDestRefName()!="") {
|
void *mkr = dlsym(dlib, ci->getDestRefName().c_str());
|
typedef void (*RfPtr) (void*);
|
RfPtr f = (RfPtr)mkr;
|
if(f!=NULL)
|
{
|
f(instance);
|
}
|
}
|
break;
|
}
|
case 1: delete (std::string*)instance; break;
|
case 2: delete (char*)instance; break;
|
case 3: delete (unsigned char*)instance; break;
|
case 4: delete (int*)instance; break;
|
case 5: delete (unsigned int*)instance; break;
|
case 6: delete (short*)instance; break;
|
case 7: delete (unsigned short*)instance; break;
|
case 8: delete (long*)instance; break;
|
case 9: delete (unsigned long*)instance; break;
|
case 10: delete (long long*)instance; break;
|
case 11: delete (unsigned long long*)instance; break;
|
case 12: delete (float*)instance; break;
|
case 13: delete (double*)instance; break;
|
case 14: delete (long double*)instance; break;
|
case 15: delete (bool*)instance; break;
|
case 16: delete (Date*)instance; break;
|
case 17: delete (BinaryData*)instance; break;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.