1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: fnd_MemoryRange.h 4 5 Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 31762 $ 14 *---------------------------------------------------------------------------*/ 15 16 /* 17 18 */ 19 20 #ifndef NN_FND_FND_MEMORYRANGE_H_ 21 #define NN_FND_FND_MEMORYRANGE_H_ 22 23 #include <nn/types.h> 24 25 #include <nn/Assert.h> 26 27 #ifdef __cplusplus 28 29 30 namespace nn { namespace fnd { 31 32 /* Please see man pages for details 33 34 */ 35 class MemoryRange 36 { 37 public: 38 MemoryRange()39 MemoryRange() {} 40 41 /* Please see man pages for details 42 43 44 45 46 47 */ MemoryRange(uptr begin,uptr end)48 MemoryRange(uptr begin, uptr end) : m_Begin(begin), m_End(end) { NN_TASSERT_(m_Begin <= m_End); } 49 50 /* Please see man pages for details 51 52 53 54 55 56 */ Initialize(uptr begin,uptr end)57 void Initialize(uptr begin, uptr end) { m_Begin = begin; m_End = end; NN_TASSERT_(m_Begin <= m_End); } 58 59 /* Please see man pages for details 60 61 */ GetAddress()62 uptr GetAddress() const { return m_Begin; } 63 64 /* Please see man pages for details 65 66 67 68 */ GetEndAddress()69 uptr GetEndAddress() const { return m_End; } 70 71 /* Please see man pages for details 72 73 74 75 */ GetSize()76 size_t GetSize() const { return m_End - m_Begin; } 77 78 private: 79 uptr m_Begin; 80 uptr m_End; 81 }; 82 83 }} 84 85 #endif 86 87 #endif 88