Ignore:
Timestamp:
10/01/21 23:40:49 (4 weeks ago)
Author:
Maciej Komosinski
Message:

Cosmetic/minor improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/extvalue.h

    r1130 r1158  
    4343class ExtObject
    4444{
    45         int subtype;                    //< 0/1=Generic/DPC Object,  0/2=Standalone/Shared Param
     45        int subtype;                    //< 0/1=Generic/DPC Object,  0/2=Standalone/Shared Param,  0/4=RW/Readonly
    4646        void incref() const;
    4747        void decref() const;
     
    7373        void setEmpty() { decref(); subtype = 0; param = NULL; object = NULL; }
    7474        int isEmpty() const { return !param; }
     75        bool isReadonly() const {return (subtype&4)!=0;}
     76        void setReadonly(bool ro) {subtype=(subtype&~4)|(ro?4:0);}
    7577        static const ExtObject& empty() { static const ExtObject e((ParamInterface*)NULL); return e; }
    7678        ExtObject(const ExtObject& src) { DEBUG_EXTOBJECT("(const&)"); src.incref(); copyFrom(src); }
     
    188190        void setInvalid() { setEmpty(); type = TInvalid; }
    189191        void setError(const SString& msg);
     192        bool isReadonly() const {return (type==TObj) && odata().isReadonly();}
     193        void setReadonly(bool ro) {if (type==TObj) odata().setReadonly(ro);}
    190194        bool makeUnique() { return (type == TObj) && odata().makeUnique(); } //< @return false if nothing has changed
    191195        ExtPType getType() const { return type; }
Note: See TracChangeset for help on using the changeset viewer.