gwnavruntime/basesystem/basesystem.h Source File

basesystem.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 // primary contact: GUAL - secondary contact: JAPA
9 #ifndef Navigation_BaseSystem_H
10 #define Navigation_BaseSystem_H
11 
18 
19 namespace Kaim
20 {
21 
22 class PerfCounterManager;
23 class IPerfMarkerInterface;
24 
43 class BaseSystemConfig
44 {
45 public:
46  BaseSystemConfig()
47  : m_defaultLogToMode(DefaultLog::LogToAll)
51  , m_rootHeapDesc(KY_NULL)
53  , m_initSymbolTable(false)
54  {}
55 
56 public:
58  GamewareKeyConfig m_gamewareKeyConfig;
59 
62  DefaultLog::LogToMode m_defaultLogToMode;
63 
68  BaseLog* m_log;
69 
74 
75  // memory allocation
83  MemoryHeap::HeapDesc* m_rootHeapDesc;
84 
88 
91  bool m_initSymbolTable;
92 };
93 
94 
104 {
105 public:
106  typedef BaseSystemConfig Config;
107 
108 public:
110  BaseSystem() { Init(Config()); }
111 
113  BaseSystem(const Config& config) { Init(config); }
114 
116  ~BaseSystem() { Destroy(); }
117 
119  static void Init(const Config& config)
120  {
121  CheckHeaderLibDesync::Check(); // Creates "unresolved external symbol" link error in case of failure.
122  DoInit(config); // do the "real" init
123  }
124 
126  static bool IsInitialized() { return s_isInitialized; }
130  static bool HasMemoryLeaks() { return System::hasMemoryLeaks; }
131 
133  static void Destroy();
134 
135 private:
136  static void DoInit(const Config& config);
137  static void DestroyMemorySystemAndLog();
138  static void RegisterBlobs();
139 
140 private:
141  static bool s_isInitialized;
142 };
144 // Wii U stuff
145 #define KY_INTERNAL_PLACEHOLDER_BASESYSTEM_H
146 
147 } // namespace Kaim
149 
150 #endif
The BaseSystemConfig class contains a set of objects and configuration parameters that are required i...
Definition: basesystem.h:48
static void Check()
This is called in user code thanks to BaseSystem::Init.
Definition: checkheaderlibdesync.h:52
IPerfMarkerInterface * m_perfMarkerInterface
Provides an instance of a custom class that implements IPerfMarkerInterface.
Definition: basesystem.h:82
BaseLog * m_log
Provides an instance of class that derives from Log, which Gameware Navigation components will invoke...
Definition: basesystem.h:76
A base class for an object that manages memory allocations and de-allocations.
Definition: SF_SysAlloc.h:33
#define KY_NULL
Null value.
Definition: types.h:247
bool m_useStackRegistryToTrackAllocations
The StackRegistry class allows to record and output the call-stacks for any leaks that remain after t...
Definition: basesystem.h:98
static bool HasMemoryLeaks()
Indicates whether or not any memory allocated by the BaseSystem remains to be freed.
Definition: basesystem.h:148
GamewareKeyConfig m_gamewareKeyConfig
Provides the gameware key.
Definition: basesystem.h:65
static void Destroy()
Destroys the BaseSystem.
bool m_initSymbolTable
This flag controls whether or not the StackRegistry calls SymInitialize() and SymCleanup().
Definition: basesystem.h:103
BaseSystemConfig Config
Defines a type for the configuration object used to initialize the BaseSystem.
Definition: basesystem.h:122
DefaultLog::LogToMode m_defaultLogToMode
Specifies the output locations in which the BaseSystem will print debug messages when using its defau...
Definition: basesystem.h:69
Definition: gamekitcrowddispersion.h:20
static void Init(const Config &config)
Sets up the BaseSystem according to the specified configuration.
Definition: basesystem.h:136
SysAllocBase * m_sysAlloc
Provides an instance of a class that implements the SysAlloc interface, which will be invoked any tim...
Definition: basesystem.h:92
static bool IsInitialized()
Indicates whether or not the BaseSystem has been successfully initialized.
Definition: basesystem.h:143
BaseLog must used instead of Kaim::Log due to parti pris for Navigation's VisualDebug.
Definition: baselog.h:19
The BaseSystem provides Gameware Navigation components with a set of objects used for memory allocati...
Definition: basesystem.h:118
BaseSystem()
Creates and sets up the new BaseSystem with a default configuration.
Definition: basesystem.h:127
~BaseSystem()
Calls static function BaseSystem::Destroy()
Definition: basesystem.h:133
An abstract interface for an object that can respond to performance tracking markers.
Definition: iperfmarkerinterface.h:22