gwnavruntime/navgraph/identifiers/navgraphrawptr.h Source File

navgraphrawptr.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 
9 // Primary contact: JODA - secondary contact: JUBA
10 #ifndef Navigation_NavGraphRawPtr_H
11 #define Navigation_NavGraphRawPtr_H
12 
15 
16 
17 namespace Kaim
18 {
19 
20 class NavGraphBlob;
21 
22 
24 // NavGraphPtr
26 
31 class NavGraphRawPtr
32 {
34 
35 public:
38  NavGraphRawPtr(NavGraph* navGraph = KY_NULL);
39 
41  bool IsValid() const;
42 
44  void Invalidate();
45 
47  bool operator ==(const NavGraphRawPtr& rhs) const;
48  bool operator !=(const NavGraphRawPtr& rhs) const;
49 
50  bool operator < (const NavGraphRawPtr& rhs) const;
51  bool operator <=(const NavGraphRawPtr& rhs) const;
52 
53 
56  NavGraph* GetNavGraph() const;
57  const NavGraphBlob* GetNavGraphBlob() const;
58 
59 private:
60  NavGraph* m_navGraph;
61 };
62 
63 KY_INLINE NavGraphRawPtr::NavGraphRawPtr(NavGraph* navGraph) : m_navGraph(navGraph) {}
64 
65 KY_INLINE bool NavGraphRawPtr::IsValid() const { return m_navGraph != KY_NULL; }
66 KY_INLINE void NavGraphRawPtr::Invalidate() { m_navGraph = KY_NULL; }
67 
68 KY_INLINE bool NavGraphRawPtr::operator ==(const NavGraphRawPtr& rhs) const { return m_navGraph == rhs.m_navGraph; }
69 KY_INLINE bool NavGraphRawPtr::operator !=(const NavGraphRawPtr& rhs) const { return !(*this == rhs); }
70 KY_INLINE bool NavGraphRawPtr::operator < (const NavGraphRawPtr& rhs) const { return m_navGraph < rhs.m_navGraph; }
71 KY_INLINE bool NavGraphRawPtr::operator <=(const NavGraphRawPtr& rhs) const { return !(rhs < *this); }
72 
73 KY_INLINE NavGraph* NavGraphRawPtr::GetNavGraph() const { return m_navGraph; }
74 KY_INLINE const NavGraphBlob* NavGraphRawPtr::GetNavGraphBlob() const { return m_navGraph->GetNavGraphBlob(); }
75 
76 } // namespace Kaim
77 
78 #endif // #ifndef Navigation_NavGraphRawPtr_H
The NavGraphBlob contains the static data of a NavGraph.
Definition: navgraphblob.h:21
#define KY_NULL
Null value.
Definition: types.h:247
void Invalidate()
Invalidates this object.
Definition: navgraphrawptr.h:70
This class uniquely identifies a NavGraph that has been loaded.
Definition: navgraphrawptr.h:33
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
bool IsValid() const
Returns true if this object refers to a valid NavGraph.
Definition: navgraphrawptr.h:69
bool operator==(const NavGraphRawPtr &rhs) const
Returns true if this object identifies the same NavGraph as navGraphPtr, or if both are invalid...
Definition: navgraphrawptr.h:72
NavGraph * GetNavGraph() const
Returns a reference to the NavGraph that handles the NavGraph.
Definition: navgraphrawptr.h:77
This class is a runtime wrapper of a NavGraphBlob, it gathers all the runtime information associated ...
Definition: navgraph.h:27