Esempio n. 1
0
PUBLIC ObjectStoreDatum *objectstore_create_list_of_items(GList *list, ObjectStore *db,
							  objectstore_pickler_t pickler) {
  int len = g_list_length(list);
  ObjectStoreDatum *result = objectstore_datum_new_array(len);
  int i;

  for (i = 0; i < len; i++, list = g_list_next(list))
    objectstore_datum_array_set(result, i, objectstore_datum_new_object(pickler(list->data, db)));

  return result;
}
Esempio n. 2
0
void Pickler::debugPickleTest(Expr e) {

  //ExprManager *em = e.getExprManager();
  //Expr e1 = mkVar("x", makeType());
  //return ;

  Pickler pickler(e.getExprManager());

  Pickle p;
  pickler.toPickle(e, p);

  uint32_t size = p.d_data->size();
  std::string str = p.d_data->toString();

  Expr from = pickler.fromPickle(p);
  ExprManagerScope ems(e);

  Debug("pickle") << "before: " << e << std::endl;
  Debug("pickle") << "after: " << from.getNode() << std::endl;
  Debug("pickle") << "pickle: (oct) "<< size << " " << str.length() << " " << str << std::endl;

  Assert(p.d_data->empty());
  Assert(e == from);
}