gwnavruntime/abstractgraph/identifiers/abstractgraphnodeptr.h Source File

abstractgraphnodeptr.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 #ifndef Navigation_AbstractGraphNodePtr_H
8 #define Navigation_AbstractGraphNodePtr_H
9 
10 
11 #include "gwnavruntime/abstractgraphtypes.h"
13 
14 namespace Kaim
15 {
16 
17 class AbstractGraph;
18 
19 class AbstractGraphNodePtr
20 {
21  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
22 public:
23  AbstractGraphNodePtr() { Invalidate(); }
24  AbstractGraphNodePtr(AbstractGraph* abstractGraph, AbstractGraphNodeIdx nodeIdx) { Set(abstractGraph, nodeIdx); }
25 
26  bool IsValid() const { return m_abstractGraph != KY_NULL && m_nodeIdx < AbstractGraphNodeIdx_Invalid; }
27  void Invalidate()
28  {
29  m_abstractGraph = KY_NULL;
30  m_nodeIdx = AbstractGraphNodeIdx_Invalid;
31  }
32 
33  void Set(AbstractGraph* abstractGraph, AbstractGraphNodeIdx nodeIdx)
34  {
35  m_abstractGraph = abstractGraph;
36  m_nodeIdx = nodeIdx;
37  }
38 
39 public:
40  Ptr<AbstractGraph> m_abstractGraph;
41  AbstractGraphNodeIdx m_nodeIdx;
42 };
43 
44 }
45 
46 #endif
#define KY_NULL
Null value.
Definition: types.h:247
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137