#ifndef __SERIALIZATION_H_
#define __SERIALIZATION_H_

#include "../mecha/mecha.h"

#include "type.h"
#include "serializationinfo.h"
#include "iterator.h"


dynTstring * serialization_serializeType (const char *typeName, void *field);
bool serialization_deserializeType (const char *typeName, void *field, dynTstring *serializationData);

dynTstring * serialization_serialize (SerializationInfo *info);
SerializationInfo * serialization_deserialize (dynTstring *string);

dynTstring * serialization_serializeList (lstTlist *list);
lstTlist * serialization_deserializeList (dynTstring *string);


// -aleigh
//typedef __typeof__ (void (*) (void *context, void *element)) DeserializationCallback;

typedef void *(*DeserializationCallback)(void *context, void *element);

dynTstring * serialization_serializeTypeList (const char *typeName, Iterator *iterator);
bool serialization_deserializeTypeList (const char *typeName, dynTstring *serializationData, 
        DeserializationCallback callback, void *context);

#endif
