That helps
Many thanks From: jfrey@xxxxxxxxxxx Date: Thu, 20 Mar 2014 16:37:37 -0500 To: htcondor-users@xxxxxxxxxxx Subject: Re: [HTCondor-users] Question about the nested ClassAd On Mar 20, 2014, at 3:20 AM, 张章 <zhang_zhang@xxxxxxxx> wrote: [ a = 1; b = { [c = 1; d = 1], [c = 2; d = 2] }; … ] I’m assuming you are using the C++ API. There could some minor syntax errors in the code below... If you have a string representation of the list of nested ads, then you can use the ClassAdParser class to parse that into the appropriate ExprTree*, and insert that into the parent ad: ClassAd parent_ad; ClassAdParser parser; ExprTree *list = parser.ParseExpression(“{ [c = 1; d = 1], [c = 2; d = 2] }”); parent_ad.Insert( “b”, list ); If you are building up the child ad objects with ClassAd::InsertAttr() calls, and then want to insert them into the parent ad, you can do this: ClassAd parent_ad; ClassAd *child_ad1 = ...; ClassAd *child_ad1 = ...; std::vector<ExprTree*> v; v.push_back(child_ad1); v.push_back(child_ad2); ExprTree *list = ExprList::MakeExprList( v ); parent_ad.Insert( “b”, list ); Once you have inserted the list of nested ads in the parent ad, modifying the list by adding or removing ads is not easy, but can be done. I hope that helps. Thanks and regards, Jaime Frey UW-Madison HTCondor Project _______________________________________________ HTCondor-users mailing list To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a subject: Unsubscribe You can also unsubscribe by visiting https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users The archives can be found at: https://lists.cs.wisc.edu/archive/htcondor-users/ |