- Timestamp:
- 04/21/15 15:19:47 (10 years ago)
- Location:
- cpp/frams
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.cpp
r348 r371 124 124 } 125 125 126 THREAD_LOCAL_DEF(ExtObject::Serialization, ExtObject ::serialization);126 THREAD_LOCAL_DEF(ExtObject::Serialization, ExtObject_serialization); 127 127 128 128 void ExtObject::Serialization::begin() … … 185 185 SString ExtObject::serialize_inner() const 186 186 { 187 int ref = tlsGetRef( serialization).add(*this);187 int ref = tlsGetRef(ExtObject_serialization).add(*this); 188 188 if (ref >= 0) 189 189 return SString::sprintf("^%d", ref); … … 216 216 } 217 217 218 tlsGetRef( serialization).remove(*this);//undo nonserializable reference218 tlsGetRef(ExtObject_serialization).remove(*this);//undo nonserializable reference 219 219 SString ret = interfaceName(); 220 220 ret += SString::sprintf("<%p>", object ? object : paraminterface); … … 224 224 SString ExtObject::serialize() const 225 225 { 226 tlsGetRef( serialization).begin();226 tlsGetRef(ExtObject_serialization).begin(); 227 227 SString ret = serialize_inner(); 228 tlsGetRef( serialization).end();228 tlsGetRef(ExtObject_serialization).end(); 229 229 return ret; 230 230 } … … 998 998 VectorObject *vec = new VectorObject; 999 999 ExtObject o(&VectorObject::par, vec); 1000 tlsGetRef(ExtObject ::serialization).add(o);1000 tlsGetRef(ExtObject_serialization).add(o); 1001 1001 const char* p = in + 1; 1002 1002 ExtValue tmp; … … 1029 1029 DictionaryObject *dic = new DictionaryObject; 1030 1030 ExtObject o(&DictionaryObject::par, dic); 1031 tlsGetRef(ExtObject ::serialization).add(o);1031 tlsGetRef(ExtObject_serialization).add(o); 1032 1032 const char* p = in + 1; 1033 1033 ExtValue args[2]/*={value,key}*/, dummy_ret; … … 1080 1080 if (ret && (ref.getType() == TInt)) 1081 1081 { 1082 const ExtObject* o = tlsGetRef(ExtObject ::serialization).get(ref.getInt());1082 const ExtObject* o = tlsGetRef(ExtObject_serialization).get(ref.getInt()); 1083 1083 if (o) 1084 1084 { … … 1105 1105 { 1106 1106 cls->call(m, &tmp, this); 1107 tlsGetRef(ExtObject ::serialization).replace(tmp.getObject(), getObject());1107 tlsGetRef(ExtObject_serialization).replace(tmp.getObject(), getObject()); 1108 1108 return ret; 1109 1109 } … … 1116 1116 { 1117 1117 cls->call(m, &tmp, this); 1118 tlsGetRef(ExtObject ::serialization).replace(tmp.getObject(), getObject());1118 tlsGetRef(ExtObject_serialization).replace(tmp.getObject(), getObject()); 1119 1119 return ret; 1120 1120 } … … 1126 1126 { 1127 1127 cls->call(m, &tmp, this); 1128 tlsGetRef(ExtObject ::serialization).replace(tmp.getObject(), getObject());1128 tlsGetRef(ExtObject_serialization).replace(tmp.getObject(), getObject()); 1129 1129 return ret; 1130 1130 } 1131 1131 } 1132 tlsGetRef(ExtObject ::serialization).remove(tmp.getObject());1132 tlsGetRef(ExtObject_serialization).remove(tmp.getObject()); 1133 1133 setEmpty(); 1134 1134 } … … 1144 1144 const char* ExtValue::deserialize(const char* in) 1145 1145 { 1146 tlsGetRef(ExtObject ::serialization).begin();1146 tlsGetRef(ExtObject_serialization).begin(); 1147 1147 const char* ret = deserialize_inner(in); 1148 tlsGetRef(ExtObject ::serialization).end();1148 tlsGetRef(ExtObject_serialization).end(); 1149 1149 return ret; 1150 1150 } -
cpp/frams/util/extvalue.h
r337 r371 99 99 }; 100 100 101 static THREAD_LOCAL_DECL(Serialization, serialization); 102 }; 101 }; 102 103 extern THREAD_LOCAL_DECL(ExtObject::Serialization, ExtObject_serialization); 103 104 104 105 class ExtValue -
cpp/frams/vm/classes/collectionobj.cpp
r333 r371 149 149 } 150 150 151 static THREAD_LOCAL_DEF(SList, tostring_trace);151 static THREAD_LOCAL_DEF(SList,VectorObject_tostring_trace); 152 152 153 153 void VectorObject::get_toString(ExtValue* ret) … … 155 155 SString out="["; 156 156 //static SListTempl<VectorObject*> trace; 157 if (tlsGetRef( tostring_trace).find(this)>=0)157 if (tlsGetRef(VectorObject_tostring_trace).find(this)>=0) 158 158 out+="..."; 159 159 else 160 160 { 161 tlsGetRef( tostring_trace)+=this;161 tlsGetRef(VectorObject_tostring_trace)+=this; 162 162 for(int i=0;i<data.size();i++) 163 163 { … … 169 169 out+="null"; 170 170 } 171 tlsGetRef( tostring_trace)-=this;171 tlsGetRef(VectorObject_tostring_trace)-=this; 172 172 } 173 173 out+="]"; … … 402 402 SString out="{"; 403 403 //static SListTempl<DictionaryObject*> trace; 404 if (tlsGetRef( tostring_trace).find(this)>=0)404 if (tlsGetRef(VectorObject_tostring_trace).find(this)>=0) 405 405 out+="..."; 406 406 else 407 407 { 408 tlsGetRef( tostring_trace)+=this;408 tlsGetRef(VectorObject_tostring_trace)+=this; 409 409 for(HashEntryIterator it(hash);it.isValid();) 410 410 { … … 418 418 if (it.isValid()) out+=","; 419 419 } 420 tlsGetRef( tostring_trace)-=this;420 tlsGetRef(VectorObject_tostring_trace)-=this; 421 421 } 422 422 out+="}";
Note: See TracChangeset
for help on using the changeset viewer.