gwnavruntime/navgraph/identifiers/navgraphrawptr.h Source File

navgraphrawptr.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
10 
13 
14 
15 namespace Kaim
16 {
17 
18 class NavGraphBlob;
19 
20 
22 // NavGraphPtr
24 
30 {
31  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
32 
33 public:
36  NavGraphRawPtr(NavGraph* navGraph = nullptr);
37 
39  bool IsValid() const;
40 
42  void Invalidate();
43 
45  bool operator ==(const NavGraphRawPtr& rhs) const;
46  bool operator !=(const NavGraphRawPtr& rhs) const;
47 
48  bool operator < (const NavGraphRawPtr& rhs) const;
49  bool operator <=(const NavGraphRawPtr& rhs) const;
50 
51 
54  NavGraph* GetNavGraph() const;
55  const NavGraphBlob* GetNavGraphBlob() const;
56 
57 private:
58  NavGraph* m_navGraph;
59 };
60 
61 KY_INLINE NavGraphRawPtr::NavGraphRawPtr(NavGraph* navGraph) : m_navGraph(navGraph) {}
62 
63 KY_INLINE bool NavGraphRawPtr::IsValid() const { return m_navGraph != nullptr; }
64 KY_INLINE void NavGraphRawPtr::Invalidate() { m_navGraph = nullptr; }
65 
66 KY_INLINE bool NavGraphRawPtr::operator ==(const NavGraphRawPtr& rhs) const { return m_navGraph == rhs.m_navGraph; }
67 KY_INLINE bool NavGraphRawPtr::operator !=(const NavGraphRawPtr& rhs) const { return !(*this == rhs); }
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 !(rhs < *this); }
70 
71 KY_INLINE NavGraph* NavGraphRawPtr::GetNavGraph() const { return m_navGraph; }
72 KY_INLINE const NavGraphBlob* NavGraphRawPtr::GetNavGraphBlob() const { return m_navGraph->GetNavGraphBlob(); }
73 
74 } // namespace Kaim
75 
The NavGraphBlob contains the static data of a NavGraph.
Definition: navgraphblob.h:19
void Invalidate()
Invalidates this object.
Definition: navgraphrawptr.h:64
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
NavGraphRawPtr(NavGraph *navGraph=nullptr)
Constructs a new NavGraphRawPtr.
Definition: navgraphrawptr.h:61
This class uniquely identifies a NavGraph that has been loaded.
Definition: navgraphrawptr.h:29
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
bool IsValid() const
Returns true if this object refers to a valid NavGraph.
Definition: navgraphrawptr.h:63
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:66
NavGraph * GetNavGraph() const
Returns a reference to the NavGraph that handles the NavGraph.
Definition: navgraphrawptr.h:71
This class is a runtime wrapper of a NavGraphBlob, it gathers all the runtime information associated ...
Definition: navgraph.h:22