Changeset 171 for cpp/frams/vm


Ignore:
Timestamp:
03/13/14 01:00:33 (11 years ago)
Author:
sz
Message:

getObjectTarget is now the recommended way to retrieve object from ExtValue?, can post the standard warning message about missing object

Location:
cpp/frams/vm/classes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/vm/classes/3dobject.cpp

    r156 r171  
    193193Pt3D_Ext* Pt3D_Ext::fromObject(const ExtValue& v)
    194194{
    195 if (v.type!=TObj) return 0;
    196 const ExtObject& o=v.getObject();
    197 return (Pt3D_Ext*)o.getTarget(getStaticParam().getName());
     195return (Pt3D_Ext*)v.getObjectTarget(getStaticParam().getName());
    198196}
    199197
     
    444442Orient_Ext* Orient_Ext::fromObject(const ExtValue& v)
    445443{
    446 if (v.type!=TObj) return 0;
    447 const ExtObject& o=v.getObject();
    448 return (Orient_Ext*)o.getTarget(getStaticParam().getName());
     444return (Orient_Ext*)v.getObjectTarget(getStaticParam().getName());
    449445}
    450446
     
    573569ReferenceObj* ReferenceObj::fromObject(const ExtValue& v)
    574570{
    575 if (v.type!=TObj) return 0;
    576 const ExtObject& o=v.getObject();
    577 return (ReferenceObj*)o.getTarget(getStaticParam().getName());
    578 }
     571return (ReferenceObj*)v.getObjectTarget(getStaticParam().getName());
     572}
  • cpp/frams/vm/classes/collectionobj.cpp

    r164 r171  
    266266}
    267267
    268 VectorObject* VectorObject::fromObject(const ExtObject& o)
    269 {
    270 return (VectorObject*)o.getTarget(par.getName());
     268VectorObject* VectorObject::fromObject(const ExtObject& o, bool warn)
     269{
     270return (VectorObject*)o.getTarget(par.getName(),true,warn);
    271271}
    272272
     
    424424}
    425425
    426 DictionaryObject* DictionaryObject::fromObject(const ExtObject& o)
    427 {
    428 return (DictionaryObject*)o.getTarget(par.getName());
     426DictionaryObject* DictionaryObject::fromObject(const ExtObject& o, bool warn)
     427{
     428return (DictionaryObject*)o.getTarget(par.getName(), true, warn);
    429429}
    430430
  • cpp/frams/vm/classes/collectionobj.h

    r121 r171  
    4444ExtObject makeObject() {return ExtObject(&par,this);}
    4545
    46 static VectorObject* fromObject(const ExtObject& o);
     46static VectorObject* fromObject(const ExtObject& o, bool warn=true);
    4747};
    4848
     
    7474static void p_new(void*,ExtValue*args,ExtValue*ret)
    7575        {ret->setObject(ExtObject(&par,new DictionaryObject));}
    76 static DictionaryObject* fromObject(const ExtObject& v);
     76static DictionaryObject* fromObject(const ExtObject& v, bool warn=true);
    7777ExtObject makeObject() {return ExtObject(&par,this);}
    7878};
  • cpp/frams/vm/classes/genoobj.cpp

    r138 r171  
    107107}
    108108
    109 Geno* GenoObj::fromObject(const ExtValue& v)
     109Geno* GenoObj::fromObject(const ExtValue& v, bool warn)
    110110{
    111 if (v.type!=TObj) return 0;
    112 const ExtObject& o=v.getObject();
    113 //if ((o.param!=&getStaticParam())&&(o.param!=&getDynamicParam())) return 0;
    114 return (Geno*)o.getTarget(getStaticParam().getName());
     111return (Geno*)v.getObjectTarget(getStaticParam().getName(), warn);
    115112}
  • cpp/frams/vm/classes/genoobj.h

    r138 r171  
    3333static ExtObject makeDynamicObject(Geno* g);
    3434static ExtObject makeDynamicObjectAndDecRef(Geno* g);
    35 static Geno* fromObject(const ExtValue& v);
     35static Geno* fromObject(const ExtValue& v, bool warn=true);
    3636static ParamInterface* getInterface();
    3737
Note: See TracChangeset for help on using the changeset viewer.