int LogSetAttribute::Play(void *data_structure) { ClassAdHashTable *table = (ClassAdHashTable *)data_structure; int rval; ClassAd *ad = 0; if (table->lookup(HashKey(key), ad) < 0) return -1; if (value_expr) { // Such a shame, do we really need to make a // copy of value_expr here? Seems like we could just // assign it and then set value_expr to NULL and avoid // copying a parse tree, since after we Play it I doubt // this class does anything more with value_expr beyond // deallocating it. - Todd 11/13 <*****@*****.**> ExprTree * pTree = value_expr->Copy(); rval = ad->Insert(name, pTree, false); } else { rval = ad->AssignExpr(name, value); } ad->SetDirtyFlag(name, is_dirty); #if defined(HAVE_DLOPEN) ClassAdLogPluginManager::SetAttribute(key, name, value); #endif return rval; }
int LogSetAttribute::Play(void *data_structure) { ClassAdHashTable *table = (ClassAdHashTable *)data_structure; int rval; ClassAd *ad = 0; if (table->lookup(HashKey(key), ad) < 0) return -1; if (value_expr) { ExprTree * pTree = value_expr->Copy(); rval = ad->Insert(name, pTree, false); } else { rval = ad->AssignExpr(name, value); } ad->SetDirtyFlag(name, is_dirty); #if defined(HAVE_DLOPEN) ClassAdLogPluginManager::SetAttribute(key, name, value); #endif return rval; }