OROCHI
 
Loading...
Searching...
No Matches
GxResBase Class Reference

リソース基底クラス More...

#include <GxResBase.h>

Inheritance diagram for GxResBase:
Collaboration diagram for GxResBase:

定義

enum class  ASYNC_STATE {
  LOADING = 0 , COMPLETE , CANCEL_REQUAST , INITIALIZED ,
  ERROR_ = -1 , CANCELED = -2
}
 非同期ロード状態 More...
 
enum class  ASYNC_PRIORITY { NORMAL = 0 , LOW }
 非同期ロード優先 More...
 
enum class  RESOURCE_BASE_ATTRIBUTE {
  USE_DATA_FROM_SYSTEM , ANY_PATH_RESOURCE , USE_MAIN_MEMORY , REGISTERED_NON_REPLACED ,
  ASYNC_SET_RESOURCE
}
 基底リソース属性定義 More...
 
class GxSysResource
 
class GxSysResourceCallback
 
class GxSysResourceAsyncLoadBase
 
static const u32 RESOURCE_VERSION = 2
 リソースバージョン定義
 
static constexpr u32 RESOURCE_PATH_MAX = GxMath::VALUE_256
 リソースパス最大長
 
static constexpr u32 RESOURCE_CUSTOM_PROPERTY_STRING_NUM = GxMath::VALUE_2
 リソースカスタムプロパティ文字列登録数 (クラス名 + パス)
 
static constexpr u32 RESOURCE_PATH_ENCRYPT_KEY_NUM = GxMath::VALUE_8
 暗号化キー個数
 

初期化

 GxResBase (void)
 コンストラクタ (※本クラスの直接インスタンス化禁止)
 
void cleanup (void) override
 解放
 
s32 release (void) override
 解放
 

操作

void createCallback (void *pUser)
 生成時コールバック
 
b32 load (GxStream &stream, u32 size)
 ロード
 
b32 loadBinary (GxStream &stream)
 バイナリリソースのロード
 
virtual GX_FORCE_INLINE void callback (void)
 
static void registerCustomProperty (void)
 カスタムプロパティ登録
 
static void customPropertyToString (GxProperty &property, GxTypedObject *pOwner, u32 index, GxString *pString, u32 &stringCount)
 カスタムプロパティ処理 (プロパティ → 文字列)
 
static void customPropertyFromString (GxProperty &property, GxTypedObject *pOwner, u32 index, GxString *pString, u32 stringCount)
 カスタムプロパティ処理 (文字列 → プロパティ)
 
static u32 customPropertyGetSerializedBinarySize (GxProperty &property, GxTypedObject *pOwner, u32 index)
 カスタムプロパティ処理 (シリアライズ後バイナリサイズ取得)
 
static void * customPropertySerializeBinary (GxProperty &property, GxTypedObject *pOwner, u32 index, void *pData)
 カスタムプロパティ処理 (バイナリシリアライズ)
 
static const void * customPropertyDeserializeBinary (GxProperty &property, GxTypedObject *pOwner, u32 index, const void *pData)
 カスタムプロパティ処理 (バイナリデシリアライズ)
 

アクセサ

constexpr void setId (u64 id)
 ID設定
 
constexpr void setFileSize (u32 fileSize)
 ファイルサイズ設定
 
constexpr void setSize (u32 size)
 サイズ設定
 
GX_FORCE_INLINE void setConfig (GxResBase *pConfig)
 コンフィグ設定
 
constexpr void setAsyncState (ASYNC_STATE asyncState)
 非同期ステート設定
 
constexpr void setAsyncPriority (ASYNC_PRIORITY asyncPriority)
 非同期優先度設定
 
constexpr GX_HANDLE getAsyncHandle (void) const
 非同期読込みハンドル取得
 
constexpr void setAsyncHandle (GX_HANDLE handle)
 非同期読込みハンドル設定
 
GX_FORCE_INLINE void setUsable (b32 flag)
 使用可能設定
 
GX_FORCE_INLINE GxZlibgetZlib (void)
 Zlib取得
 
constexpr void * getDataFromSystem (void)
 システム受け渡しデータを取得
 
GX_FORCE_INLINE void setResourceBaseAttribute (RESOURCE_BASE_ATTRIBUTE attribute, b32 enable)
 リソース属性設定
 
constexpr u64 getId (void) const
 ID取得
 
GX_FORCE_INLINE void setPath (GX_CSTR path)
 パス設定
 
constexpr GX_CSTR getPath (void) const
 パス取得
 
constexpr u32 getFileSize (void) const
 ファイルサイズ取得
 
constexpr u32 getSize (void) const
 サイズ取得
 
constexpr GxResBasegetConfig (void) const
 コンフィグ取得
 
constexpr ASYNC_STATE getAsyncState (void) const
 非同期ステート取得
 
GX_FORCE_INLINE b32 isAsyncState (ASYNC_STATE asyncState) const
 非同期ステート判定
 
GX_FORCE_INLINE b32 isAsyncStateWorking (void) const
 非同期動作中判定
 
constexpr ASYNC_PRIORITY getAsyncPriority (void) const
 非同期優先度取得
 
GX_FORCE_INLINE b32 isUsable (void) const
 使用可能判定
 
constexpr GX_CSTR getExtension (void) const
 拡張子取得
 
constexpr u32 getMagicNumber (void) const
 マジックナンバー取得
 
constexpr u32 getVersion (void) const
 バージョン取得
 
GX_FORCE_INLINE void setOriginalPath (GX_CSTR path)
 オリジナルパス設定
 
constexpr GX_CSTR getOriginalPath (void) const
 オリジナルパス取得
 
GX_FORCE_INLINE b32 isResourceBaseAttribute (RESOURCE_BASE_ATTRIBUTE attribute) const
 リソース属性判定
 

Additional Inherited Members

- Public Member Functions inherited from GxClassBaseReference
 GxClassBaseReference (void)
 コンストラクタ
 
 GxClassBaseReference (const GxClassBaseReference &base)
 コピーコンストラクタ
 
 ~GxClassBaseReference (void) override
 デストラクタ
 
constexpr GxClassBaseReferenceoperator= (const GxClassBaseReference &base)
 代入演算子
 
virtual s32 addReference (void)
 参照カウンタを加算
 
virtual s32 getReferenceCount (void) const
 参照カウンタを取得
 
constexpr void setDelayReleaseCount (s32 count)
 遅延解放カウンタを設定
 
void setDelayReleaseCountInfinity (b32 on)
 無限解放待ちの設定
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 
- Static Public Member Functions inherited from GxClassBaseReference
static void initializeDelayRelease (void)
 遅延解放リストの初期化
 
static void terminateDelayRelease (void)
 遅延解放リストの終了
 
static void updateDelayRelease (void)
 遅延解放リストの更新
 
static b32 isDelayReleaseEnable (void)
 遅延解放システムの有効判定
 
static u32 getDelayReleaseListCount (void)
 遅延解放待ちの数を取得
 
- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 
- Static Public Attributes inherited from GxClassBaseReference
static constexpr s32 DELAY_RELEASE_COUNT_INFINITY = -1
 遅延解放の無限待ち定義
 
- Protected Attributes inherited from GxClassBaseReference
s32 _referenceCount
 参照カウンタ
 
s32 _delayReleaseCount
 遅延解放カウンタ
 

Detailed Description

リソース基底クラス

Member Enumeration Documentation

◆ ASYNC_PRIORITY

enum class GxResBase::ASYNC_PRIORITY
strong

非同期ロード優先

Enumerator
NORMAL 

非同期ロード優先:通常

LOW 

非同期ロード優先:低 (バックグラウンド)

◆ ASYNC_STATE

enum class GxResBase::ASYNC_STATE
strong

非同期ロード状態

Enumerator
LOADING 

非同期読み込み中

COMPLETE 

非同期読み込み完了

CANCEL_REQUAST 

非同期読み込みキャンセルリクエスト中

INITIALIZED 

非同期読み前の初期状態

ERROR_ 

非同期読み込みエラー発生

CANCELED 

非同期読み込みキャンセル

◆ RESOURCE_BASE_ATTRIBUTE

基底リソース属性定義

Enumerator
USE_DATA_FROM_SYSTEM 

システム受け渡しデータ直接利用

ANY_PATH_RESOURCE 

ファイナライズデータ直接読み込み

USE_MAIN_MEMORY 

メインメモリに退避

REGISTERED_NON_REPLACED 

変換前パスを登録.

ASYNC_SET_RESOURCE 

非同期 createAndSetResource() が使用された

Member Function Documentation

◆ callback()

virtual GX_FORCE_INLINE void GxResBase::callback ( void )
inlinevirtual

コールバック処理

Note
コールバックは、リソースシステムを介してメインスレッドで呼び出されます
Here is the caller graph for this function:

◆ cleanup()

◆ createCallback()

GX_FORCE_INLINE void GxResBase::createCallback ( void * pUser)
protected

生成時コールバック

Parameters
pUser[in,out] ユーザ定義任意ポインタ

◆ customPropertyDeserializeBinary()

const void * GxResBase::customPropertyDeserializeBinary ( GxProperty & property,
GxTypedObject * pOwner,
u32 index,
const void * pData )
static

カスタムプロパティ処理 (バイナリデシリアライズ)

Parameters
property[in] 対象プロパティ
pOwner[in] 対象プロパティの持ち主
index[in] 配列プロパティの際のインデックス
pData[in] デシリアライズデータポインタ
Returns
デシリアライズデータ更新ポインタ (渡したデシリアライズポインタから変更なければデシリアライズなし)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ customPropertyFromString()

void GxResBase::customPropertyFromString ( GxProperty & property,
GxTypedObject * pOwner,
u32 index,
GxString * pString,
u32 stringCount )
static

カスタムプロパティ処理 (文字列 → プロパティ)

Parameters
property[in,out]対象プロパティ
pOwner[in] 対象プロパティの持ち主
index[in] 配列プロパティの際のインデックス
pString[in] 文字列登録バッファ
stringCount[in] 文字列登録個数
Note
開発時以外は処理なし
Here is the call graph for this function:
Here is the caller graph for this function:

◆ customPropertyGetSerializedBinarySize()

u32 GxResBase::customPropertyGetSerializedBinarySize ( GxProperty & property,
GxTypedObject * pOwner,
u32 index )
static

カスタムプロパティ処理 (シリアライズ後バイナリサイズ取得)

Parameters
property[in] 対象プロパティ
pOwner[in] 対象プロパティの持ち主
index[in] 配列プロパティの際のインデックス
Returns
バイナリシリアライズに必要なサイズ
Note
開発時以外は処理なし
Here is the call graph for this function:
Here is the caller graph for this function:

◆ customPropertySerializeBinary()

void * GxResBase::customPropertySerializeBinary ( GxProperty & property,
GxTypedObject * pOwner,
u32 index,
void * pData )
static

カスタムプロパティ処理 (バイナリシリアライズ)

Parameters
property[in] 対象プロパティ
pOwner[in] 対象プロパティの持ち主
index[in] 配列プロパティの際のインデックス
pData[out] シリアライズデータ格納先
Returns
格納先バッファ書き込み終端ポインタ (渡した格納先ポインタから変更なければ書き込みなし)
Note
開発時以外は処理なし
Here is the call graph for this function:
Here is the caller graph for this function:

◆ customPropertyToString()

void GxResBase::customPropertyToString ( GxProperty & property,
GxTypedObject * pOwner,
u32 index,
GxString * pString,
u32 & stringCount )
static

カスタムプロパティ処理 (プロパティ → 文字列)

Parameters
property[in] 対象プロパティ
pOwner[in] 対象プロパティの持ち主
index[in] 配列プロパティの際のインデックス
pString[out] 文字列登録バッファ
stringCount[out] 文字列登録個数
Note
開発時以外は処理なし
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

GX_FORCE_INLINE b32 GxResBase::load ( GxStream & stream,
u32 size )
protected

ロード

Parameters
stream[in] 読み込みストリーム
size[in] リソースデータサイズ
Returns
成功ならtrue
Note
継承クラスにてオーバライド実装が必要です。(本来は純粋仮想関数にしたいがメンバが居るので呼び出し時ASSERT実装)

◆ loadBinary()

GX_FORCE_INLINE b32 GxResBase::loadBinary ( GxStream & stream)
protected

バイナリリソースのロード

Parameters
stream[in] 読み込みストリーム
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ release()

s32 GxResBase::release ( void )
overridevirtual

解放

Returns
カウント数

Reimplemented from GxClassBaseReference.

Here is the call graph for this function:

The documentation for this class was generated from the following files: