iserializer.h

来自「这是整套横扫千军3D版游戏的源码」· C头文件 代码 · 共 34 行

H
34
字号

#ifndef SERIALIZE_IFACE_H
#define SERIALIZE_IFACE_H

namespace creg
{
	class Class;

	/// Serializer interface
	class ISerializer
	{
	public:
		virtual ~ISerializer();
		virtual bool IsWriting () = 0;

		/// Serialize a memory buffer
		virtual void Serialize (void *data, int byteSize) = 0;

		/// Serialize a pointer to an instance of a creg registered class/struct
		virtual void SerializeObjectPtr (void **ptr, Class *objectClass) = 0;
		
		/** Serialize an instance of an object, could be a structure embedded into another object
		 * The big difference with SerializeObjectPtr, is that the caller of this function
		 * controls the allocation of the object instead of the creg serializer itself */
		virtual void SerializeObjectInstance (void *inst, Class *objectClass) = 0;

		// Add a callback that will be called after all serialization is done
		virtual void AddPostLoadCallback (void (*cb)(void *userdata), void *userdata) = 0;
	};

}

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?