From 72bad342ad75294ae85aac8b2e2e7bea54193c15 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 31 Mar 2019 19:59:58 +0800 Subject: *misc --- source/modules/asura-utils/io/renewable.h | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/modules/asura-utils/io/renewable.h (limited to 'source/modules/asura-utils/io/renewable.h') diff --git a/source/modules/asura-utils/io/renewable.h b/source/modules/asura-utils/io/renewable.h new file mode 100644 index 0000000..769bdf6 --- /dev/null +++ b/source/modules/asura-utils/io/renewable.h @@ -0,0 +1,38 @@ +#ifndef __ASURA_ENGINE_RENEWABLE_H__ +#define __ASURA_ENGINE_RENEWABLE_H__ + +#include "../scripting/portable.hpp" + +#include "decoded_data.h" + +namespace AsuraEngine +{ + namespace IO + { + + /// + /// 可以重新构建的数据结构。比如图片、音频这种,从解析后数据可以直接构建,可以在编辑器内重 + /// 新构建,不会修改handle值,改变不具备破坏性,适用于不改变handle的资源。 + /// + ASURA_ABSTRACT class Renewable + { + public: + Renewable(); + virtual ~ Renewable(); + + /// + /// 继承Renewable的需要提供一个Refresh方法 + /// + /// 依据Effective C++条款09.应该禁止在构造函数中调用virtual方法,所以这里的Refresh + /// 被从构造函数中抽离,需要手动调用Refresh。 + /// + virtual bool Refresh(AEIO::DecodedData* decode_data) = 0; + + }; + + } +} + +namespace AEIO = AsuraEngine::IO; + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0