/*---------------------------------------------------------------------------* Project: Horizon File: cec_MessageId.h Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 25783 $ *---------------------------------------------------------------------------*/ #ifndef NN_CEC_CTR_CEC_MESSAGEID_H_ #define NN_CEC_CTR_CEC_MESSAGEID_H_ #include #include namespace nn { namespace cec { namespace CTR { // 互換性の為に残す typedef u8 CECMessageId[CEC_SIZEOF_MESSAGEID]; /*! * @brief メッセージ ID */ class MessageId { public: static const size_t SIZE = MESSAGE_ID_SIZE; static const size_t ENCODED_SIZE = 12 /*(SIZE * 4 / 3) + (3 - (SIZE * 4 / 3) % 3)*/; /*! * @brief コンストラクタ */ MessageId(void); explicit MessageId(const u8 msgId[SIZE]); explicit MessageId(const char* msgId); explicit MessageId(CECMessageId msgId);// NN_ATTRIBUTE_DEPRECATED; void GenerateNewId(u64 uniqueId); /*! * @brief MessageIdのバイナリ列を取得します。 */ const u8* GetBinary(void) const; void GetBinary(u8 msgId[SIZE]) const; bool IsEqual(const u8 msgId[SIZE]) const; bool IsEmpty(void) const; const char* GetString(void) const; const char* GetEncodedString(void) const; private: u8 m_data[SIZE]; static char s_buffer[SIZE * 2 + 1]; }; inline const u8* MessageId::GetBinary(void) const { return m_data; } } // namespace CTR } // namespace cec } // namespace nn #endif //NN_CEC_CTR_CEC_MESSAGEID_H_