NAP
rttiobjectgraphitem.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // External Includes
8 #include <unordered_map>
9 #include <rtti/typeinfo.h>
10 
11 namespace nap
12 {
13  namespace rtti
14  {
15  class Object;
16  }
17 
18  namespace utility
19  {
20  class ErrorState;
21  }
22 
29  {
30  public:
31  using Type = rtti::Object*;
32 
33  enum class EType : uint8_t
34  {
35  Object,
36  File
37  };
38 
43  static const RTTIObjectGraphItem create(rtti::Object* object);
44 
48  const std::string getID() const;
49 
53  uint8_t getType() const { return (uint8_t)mType; }
54 
55 
62  bool getPointees(std::vector<RTTIObjectGraphItem>& pointees, utility::ErrorState& errorState) const;
63 
64  EType mType; // Type: file or object
65  std::string mFilename; // If type is file, contains filename
66  rtti::Object* mObject = nullptr; // If type is object, contains object pointer
67  };
68 
69  template<typename ITEM> class ObjectGraph;
71 }
nap::RTTIObjectGraphItem::EType::Object
@ Object
nap::RTTIObjectGraphItem::mType
EType mType
Definition: rttiobjectgraphitem.h:64
nap::rtti::Object
Definition: object.h:30
nap::utility::ErrorState
Definition: errorstate.h:19
nap::ObjectGraph
Definition: objectgraph.h:20
nap::RTTIObjectGraphItem::mFilename
std::string mFilename
Definition: rttiobjectgraphitem.h:65
nap::RTTIObjectGraphItem::getType
uint8_t getType() const
Definition: rttiobjectgraphitem.h:53
nap::RTTIObjectGraphItem
Definition: rttiobjectgraphitem.h:28
nap::RTTIObjectGraphItem::create
static const RTTIObjectGraphItem create(rtti::Object *object)
nap::RTTIObjectGraphItem::EType
EType
Definition: rttiobjectgraphitem.h:33
nap::RTTIObjectGraphItem::getID
const std::string getID() const
nap
Definition: templateapp.h:17
nap::RTTIObjectGraphItem::EType::File
@ File
nap::RTTIObjectGraphItem::getPointees
bool getPointees(std::vector< RTTIObjectGraphItem > &pointees, utility::ErrorState &errorState) const
nap::RTTIObjectGraphItem::mObject
rtti::Object * mObject
Definition: rttiobjectgraphitem.h:66