Changeset 478 for cpp/frams/util
- Timestamp:
- 03/22/16 01:19:47 (9 years ago)
- Location:
- cpp/frams/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.cpp
r472 r478 104 104 } 105 105 106 bool ExtObject::callDelegate(const char* delegate,ExtValue *args,ExtValue *ret) 107 { 108 Param tmp; 109 ParamInterface *pi=getParamInterface(tmp); 110 if (pi) 111 { 112 int f=pi->findId(delegate); 113 if (f>=0) 114 { 115 pi->call(f,args,ret); 116 return true; 117 } 118 } 119 logPrintf("Genotype","get", LOG_ERROR, "Could not call delegate '%s.%s'", pi?pi->getName():"NULL",delegate); 120 return false; 121 } 106 122 107 123 SString ExtObject::toString() const … … 644 660 else 645 661 { 646 logPrintf("ExtValue", "divide", LOG_ CRITICAL, "Division by zero: %d/0", idata());662 logPrintf("ExtValue", "divide", LOG_ERROR, "Division by zero: %d/0", idata()); 647 663 setInvalid(); 648 664 } … … 653 669 if (a == 0.0) 654 670 { 655 logPrintf("ExtValue", "divide", LOG_ CRITICAL, "Division by zero: %s/0.0", getString().c_str());671 logPrintf("ExtValue", "divide", LOG_ERROR, "Division by zero: %s/0.0", getString().c_str()); 656 672 setInvalid(); 657 673 } … … 662 678 if (!finite(tmp)) 663 679 { 664 logPrintf("ExtValue", "divide", LOG_ CRITICAL, "Overflow %s/%g", getString().c_str(), a); setInvalid();680 logPrintf("ExtValue", "divide", LOG_ERROR, "Overflow %s/%g", getString().c_str(), a); setInvalid(); 665 681 } 666 682 else … … 868 884 case TString: return getInt(sdata().c_str()); 869 885 case TObj: 870 logPrintf("ExtValue", "getInt", LOG_ WARN, "Getting integer value from object reference (%s)", getString().c_str());886 logPrintf("ExtValue", "getInt", LOG_ERROR, "Getting integer value from object reference (%s)", getString().c_str()); 871 887 return (paInt)(intptr_t)odata().param; 872 888 default:; … … 883 899 case TString: return getDouble(sdata().c_str()); 884 900 case TObj: 885 logPrintf("ExtValue", "getDouble", LOG_ WARN, "Getting floating point value from object reference (%s)", getString().c_str());901 logPrintf("ExtValue", "getDouble", LOG_ERROR, "Getting floating point value from object reference (%s)", getString().c_str()); 886 902 return (double)(intptr_t)odata().param; 887 903 default:; -
cpp/frams/util/extvalue.h
r464 r478 67 67 void* getTarget() const { return (subtype & 1) ? dbobject : object; } 68 68 void* getTarget(const char* classname, bool through_barrier = true, bool warn = true) const; 69 bool callDelegate(const char* delegate,ExtValue *args,ExtValue *ret); 69 70 void setEmpty() { decref(); subtype = 0; param = NULL; object = NULL; } 70 71 int isEmpty() const { return !param; }
Note: See TracChangeset
for help on using the changeset viewer.