- Timestamp:
- 04/11/14 23:39:36 (11 years ago)
- Location:
- cpp/frams
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.cpp
r205 r222 706 706 } 707 707 708 PtrListTempl<ParamInterface*> ExtValue::deserializable_classes; 709 710 void ExtValue::initDeserializableClasses() 711 { 712 deserializable_classes+=&Pt3D_Ext::getStaticParam(); 713 deserializable_classes+=&Orient_Ext::getStaticParam(); 714 deserializable_classes+=&GenoObj::getStaticParam(); 708 PtrListTempl<ParamInterface*> &ExtValue::getDeserializableClasses() 709 { 710 static PtrListTempl<ParamInterface*> classes; 711 return classes; 715 712 } 716 713 717 714 ParamInterface *ExtValue::findDeserializableClass(const char* name) 718 715 { 719 FOREACH(ParamInterface*,cls, deserializable_classes)716 FOREACH(ParamInterface*,cls,getDeserializableClasses()) 720 717 if (!strcmp(cls->getName(),name)) 721 718 return cls; -
cpp/frams/util/extvalue.h
r205 r222 160 160 const char* deserialize(const char* in);//< @return first character after the succesfully parsed string or NULL if failed 161 161 const char* deserialize_inner(const char* in); 162 static PtrListTempl<ParamInterface*> deserializable_classes;163 162 static ParamInterface *findDeserializableClass(const char* name); 164 static void initDeserializableClasses(); 163 static PtrListTempl<ParamInterface*> &getDeserializableClasses(); 164 template<typename T> class AddDeserializable 165 { 166 public: 167 AddDeserializable() {ExtValue::getDeserializableClasses()+=&T::getStaticParam();} 168 }; 169 165 170 static SString format(SString& fmt,const ExtValue **values,int count); 166 171 … … 188 193 }; 189 194 195 #define REGISTER_DESERIALIZABLE(name) ExtValue::AddDeserializable<name> deserializable_autoinit_ ## name; 190 196 191 197 #endif -
cpp/frams/util/sstring.cpp
r198 r222 4 4 5 5 #include "sstring.h" 6 #include <common/nonstd.h> //to be sure the vsnprintf-related stuff gets included 6 7 7 8 #ifdef SSTRING_SIMPLE … … 399 400 return s; 400 401 } 401 402 #ifdef LINUX403 #define VSNPRINTF_RETURNS_REQUIRED_SIZE404 #endif405 #if defined _WIN32 && !defined __BORLANDC__406 #define USE_VSCPRINTF407 #endif408 409 402 410 403 #if 0 //testing _vscprintf -
cpp/frams/vm/classes/3dobject.cpp
r197 r222 203 203 ExtObject Pt3D_Ext::makeDynamicObject(Pt3D_Ext* p) 204 204 {return ExtObject(&getStaticParam(),p);} 205 206 ExtObject Pt3D_Ext::makeDynamicObject(const Pt3D& p) 207 { 208 Pt3D_Ext *pe=new Pt3D_Ext(p); 209 return ExtObject(&getStaticParam(),pe); 210 } 205 211 206 212 ////////////////////////////////////// … … 571 577 return (ReferenceObj*)v.getObjectTarget(getStaticParam().getName()); 572 578 } 579 580 ///////////// 581 582 REGISTER_DESERIALIZABLE(Pt3D_Ext) 583 REGISTER_DESERIALIZABLE(Orient_Ext) -
cpp/frams/vm/classes/3dobject.h
r197 r222 38 38 static ExtObject makeStaticObject(Pt3D* p); 39 39 static ExtObject makeDynamicObject(Pt3D_Ext* p); 40 static ExtObject makeDynamicObject(const Pt3D& p); 40 41 static Pt3D_Ext* fromObject(const ExtValue& v); 41 42 static Param& getStaticParam(); -
cpp/frams/vm/classes/genoobj.cpp
r219 r222 137 137 ret->setEmpty(); 138 138 } 139 140 ///////////// 141 142 REGISTER_DESERIALIZABLE(GenoObj)
Note: See TracChangeset
for help on using the changeset viewer.