- Timestamp:
- 03/26/16 01:32:18 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.h
r478 r482 14 14 template <int A, int B> struct CompileTimeMax { enum { val = A > B ? A : B }; }; 15 15 #define EXTVALUEUNIONSIZE CompileTimeMax<sizeof(ExtObject),sizeof(SString)>::val 16 17 //#define DEBUG_EXTOBJECT(txt) printf("%p ExtObj::" txt "\n",this) 18 #define DEBUG_EXTOBJECT(txt) 16 19 17 20 enum ExtPType … … 70 73 void setEmpty() { decref(); subtype = 0; param = NULL; object = NULL; } 71 74 int isEmpty() const { return !param; } 72 static const ExtObject& empty() { static const ExtObject &e((ParamInterface*)NULL); return e; }73 ExtObject(const ExtObject& src) { src.incref(); copyFrom(src); }75 static const ExtObject& empty() { static const ExtObject e((ParamInterface*)NULL); return e; } 76 ExtObject(const ExtObject& src) { DEBUG_EXTOBJECT("(const&)"); src.incref(); copyFrom(src); } 74 77 void operator=(const ExtObject& src) { src.incref(); decref(); copyFrom(src); } 75 78 bool makeUnique();//< @return false if nothing has changed … … 81 84 SString serialize(SerializationFormat format) const; 82 85 83 ExtObject(Param *p, void *o) :subtype(2), object(o), param(p) {}84 ExtObject(ParamInterface *p = 0) :subtype(0), object(0), paraminterface(p) {}85 ExtObject(Param *p, DestrBase *o) :subtype(1 + 2), dbobject(o), param(p){ incref(); }86 ExtObject(ParamInterface *p, DestrBase *o) :subtype(1), dbobject(o), paraminterface(p){ incref(); }87 88 ~ExtObject(){ decref(); }86 ExtObject(Param *p, void *o) :subtype(2), object(o), param(p) { DEBUG_EXTOBJECT("(Param,void)");} 87 ExtObject(ParamInterface *p = 0) :subtype(0), object(0), paraminterface(p) { DEBUG_EXTOBJECT("(ParamInterface)"); } 88 ExtObject(Param *p, DestrBase *o) :subtype(1 + 2), dbobject(o), param(p){ DEBUG_EXTOBJECT("(Param,DestrBase)"); incref(); } 89 ExtObject(ParamInterface *p, DestrBase *o) :subtype(1), dbobject(o), paraminterface(p){ DEBUG_EXTOBJECT("(ParamInterface,DestrBase)"); incref(); } 90 91 ~ExtObject(){ DEBUG_EXTOBJECT("~"); decref(); } 89 92 90 93 class Serialization
Note: See TracChangeset
for help on using the changeset viewer.