CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
common_ResultUtility.h
1 /*--------------------------------------------------------------------------------*
2  Copyright (C)Nintendo All rights reserved.
3 
4  These coded instructions, statements, and computer programs contain proprietary
5  information of Nintendo and/or its licensed developers and are protected by
6  national and international copyright laws. They may not be disclosed to third
7  parties or copied or duplicated in any form, in whole or in part, without the
8  prior written consent of Nintendo.
9 
10  The content herein is highly confidential and should be handled accordingly.
11  *--------------------------------------------------------------------------------*/
12 
13 
14 #pragma once
15 
16 #include <nn/pia/common/common_Definitions.h>
17 #include <nn/pia/common/common_Trace.h>
18 
19 #if NN_PIA_ENABLE_TRACE
20 
21 /*!
22 @brief Result の内容を常にトレース出力します。
23 
24 @param result Result の値。
25  */
26 #define PIA_TRACE_RESULT_ALWAYS(result) \
27  \
28 { \
29  PIA_TRACE(nn::pia::common::TraceFlagAlways, "%s, line: %d", PIA_CODE_POSITION_FILE, PIA_CODE_POSITION_LINE); \
30  nn::pia::common::ResultUtility::TraceResult(result); \
31  \
32 }
33 
34 
35 /*!
36 @brief Result の内容をトレース出力します。
37 
38 @param flag トレースフラグ。
39 @param result Result の値。
40  */
41 #define PIA_TRACE_RESULT(flag, result) \
42  \
43 { \
44  PIA_TRACE(flag, "%s, line: %d", PIA_CODE_POSITION_FILE, PIA_CODE_POSITION_LINE); \
45  nn::pia::common::ResultUtility::TraceResult(flag, result); \
46  \
47 }
48 
49 
50 #else // else of NN_PIA_ENABLE_TRACE
51 
52 #define PIA_TRACE_RESULT_ALWAYS(result) (void)(result)
53 #define PIA_TRACE_RESULT(flag, result) (void)(flag), (void)(result)
54 
55 #endif // end of NN_PIA_ENABLE_TRACE
56 
57 namespace nn
58 {
59 namespace pia
60 {
61 namespace common
62 {
63 
64 
65 /*!
66  @brief Result に関係するユーティリティ類をまとめたクラスです。
67 
68  */
70 {
71 public:
72  /*!
73  @brief nn::pia::Result 値の詳細な情報を表示します。
74  @param[in] result トレース対象の Result値。
75  */
76  static void TraceResult(const Result& result);
77 
78 #if !NN_PIA_WIN && !NN_PIA_A && !NN_PIA_B
79  /*!
80  @brief nn::Result 値の詳細な情報を表示します。
81  @param[in] result トレース対象の Result値。
82  */
83  static void TraceResult(const nn::Result& result);
84 #endif
85 
86  /*!
87  @brief nn::pia::Result 値の詳細な情報を表示します。
88 
89  @param[in] traceFlags トレースフラグ。詳細は@ref TraceFlag を参照してください。
90  @param[in] result トレース対象の Result値。
91  */
92  static void TraceResult(uint64_t traceFlags, const Result& result);
93 
94 #if !NN_PIA_WIN && !NN_PIA_A && !NN_PIA_B
95  /*!
96  @brief nn::Result 値の詳細な情報を表示します。
97 
98  @param[in] traceFlags トレースフラグ。詳細は@ref TraceFlag を参照してください。
99  @param[in] result トレース対象の Result値。
100  */
101  static void TraceResult(uint64_t traceFlags, const nn::Result& result);
102 #endif
103 
104 
105 private:
106  /*!
107  @brief インスタンスを作ることはないのでコンストラクタは封印します。
108  */
109  ResultUtility(void);
110 
111  /*!
112  @brief デストラクタは封印します。
113  */
114  ~ResultUtility(void);
115 
116  NN_PIA_DISALLOW_COPY(ResultUtility);
117 };
118 }
119 }
120 } // end of namespace nn::pia::common