1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     fnd_MemoryRange.h
4 
5   Copyright (C)2009-2012 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: 47798 $
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 
36  */
37 class MemoryRange
38 {
39 public:
40 
MemoryRange()41     MemoryRange() {}
42 
43     /* Please see man pages for details
44 
45 
46 
47 
48 
49     */
MemoryRange(uptr begin,uptr end)50     MemoryRange(uptr begin, uptr end) : m_Begin(begin), m_End(end) { NN_TASSERT_(m_Begin <= m_End); }
51 
52     /* Please see man pages for details
53 
54 
55 
56 
57 
58     */
Initialize(uptr begin,uptr end)59     void Initialize(uptr begin, uptr end) { m_Begin = begin; m_End = end; NN_TASSERT_(m_Begin <= m_End); }
60 
61     /* Please see man pages for details
62 
63     */
GetAddress()64     uptr GetAddress() const { return m_Begin; }
65 
66     /* Please see man pages for details
67 
68 
69 
70     */
GetEndAddress()71     uptr GetEndAddress() const { return m_End; }
72 
73     /* Please see man pages for details
74 
75 
76 
77     */
GetSize()78     size_t GetSize() const { return m_End - m_Begin; }
79 
80 private:
81     uptr m_Begin;
82     uptr m_End;
83 };
84 
85 }}
86 
87 #endif
88 
89 #endif
90