|
|
@ -265,6 +265,12 @@ public: |
|
|
|
if(gname==name) return val->Copy(); |
|
|
|
if(gname==name) return val->Copy(); |
|
|
|
else return 0; |
|
|
|
else return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// This function is same as Get but return pointer on constant object
|
|
|
|
|
|
|
|
const ObjectBase* Find(const std::string& gname) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(gname==name) return val.get(); |
|
|
|
|
|
|
|
else return 0; |
|
|
|
|
|
|
|
} |
|
|
|
std::string Name() const {return name;} |
|
|
|
std::string Name() const {return name;} |
|
|
|
void SetPair(const std::string& n, ObjectBase* v) {if(!Exist()) {name=n; val.reset(v);}} |
|
|
|
void SetPair(const std::string& n, ObjectBase* v) {if(!Exist()) {name=n; val.reset(v);}} |
|
|
|
const ObjectBase* Value() const {return val.get();} |
|
|
|
const ObjectBase* Value() const {return val.get();} |
|
|
@ -347,14 +353,20 @@ public: |
|
|
|
bool Exist() const {return 0!=vals->size();} |
|
|
|
bool Exist() const {return 0!=vals->size();} |
|
|
|
ObjectBase* Get(const std::string& gname) const |
|
|
|
ObjectBase* Get(const std::string& gname) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
ObjectBase* p; |
|
|
|
const ObjectBase* p=Find(gname); |
|
|
|
|
|
|
|
return (0==p)?0:p->Copy(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// This function is same as Get but return pointer on constant object
|
|
|
|
|
|
|
|
const ObjectBase* Find(const std::string& gname) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
const ObjectBase* p; |
|
|
|
for(auto& i: *vals) |
|
|
|
for(auto& i: *vals) |
|
|
|
{ |
|
|
|
{ |
|
|
|
p=0; |
|
|
|
p=0; |
|
|
|
OBType<ObjectPair> pair(i); |
|
|
|
OBType<ObjectPair> pair(i); |
|
|
|
OBType<ObjectList> list(i); |
|
|
|
OBType<ObjectList> list(i); |
|
|
|
if(pair) p=pair->Get(gname); |
|
|
|
if(pair) p=pair->Find(gname); |
|
|
|
else if(list) p=list->Get(gname); |
|
|
|
else if(list) p=list->Find(gname); |
|
|
|
if(0!=p) return p; |
|
|
|
if(0!=p) return p; |
|
|
|
} |
|
|
|
} |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|