gwnavgeneration/generator/generatorbasesystem.h Source File

generatorbasesystem.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 // primary contact: GUAL - secondary contact: MUBI
8 #ifndef GwNavGen_GeneratorBaseSystem_H
9 #define GwNavGen_GeneratorBaseSystem_H
10 
15 
16 namespace Kaim
17 {
18 
23 class GeneratorBaseSystem
24 {
25 public:
26  typedef BaseSystemConfig Config;
27 
28 public:
31  {
32  BaseSystemConfig config;
33  Init(config);
34  }
35 
37  GeneratorBaseSystem(BaseSystemConfig& config) { Init(config); }
38 
41 
43  static void Init(BaseSystemConfig& config)
44  {
45  if (config.m_sysAlloc == KY_NULL)
46  config.m_sysAlloc = GeneratorSysAllocMalloc::InitSystemSingleton();
47 
48  // Init the BaseSystem
49  BaseSystem::Init(config);
50  if (BaseSystem::IsInitialized() == false)
51  return;
52 
53  // Register gwnavgeneration.lib specific Blobs.
54  // This is not done in BaseSystem::Init() because BaseSystem::Init() is part of gwnavruntime.lib,
55  // and gwnavgeneration.lib depend on gwnavruntime.lib.
56  GeneratorCategoryBuilder generatorCategoryBuilder;
57  BlobRegistry::AddCategory(&generatorCategoryBuilder);
58  }
59 
61  static bool IsInitialized() { return BaseSystem::IsInitialized(); }
62 
65  static bool HasMemoryLeaks() { return BaseSystem::IsInitialized(); }
66 };
67 
68 } // namespace Kaim
69 
70 
71 #endif
The BaseSystemConfig class contains a set of objects and configuration parameters that are required i...
Definition: basesystem.h:48
GeneratorBaseSystem()
Creates and sets up the new BaseSystem with a default configuration.
Definition: generatorbasesystem.h:34
static void Init(BaseSystemConfig &config)
Initialize.
Definition: generatorbasesystem.h:47
#define KY_NULL
Null value.
Definition: types.h:247
BaseSystemConfig Config
Defines a type for the configuration object used to initialize the GeneratorBaseSystem.
Definition: generatorbasesystem.h:29
static void Destroy()
Destroys the BaseSystem.
static bool IsInitialized()
Indicates whether or not the BaseSystem has been successfully initialized.
Definition: generatorbasesystem.h:65
static bool HasMemoryLeaks()
Indicates whether or not any memory allocated by the GeneratorBaseSystem remains to be freed...
Definition: generatorbasesystem.h:70
Definition: gamekitcrowddispersion.h:20
~GeneratorBaseSystem()
Calls static function BaseSystem::Destroy()
Definition: generatorbasesystem.h:44
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