gwnavgeneration/generator/generatorbasesystem.h Source File

generatorbasesystem.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 #pragma once
8 
13 
14 namespace Kaim
15 {
16 
22 {
23 public:
25 
26 public:
29  {
30  BaseSystemConfig config;
31  Init(config);
32  }
33 
36 
39 
41  static void Init(BaseSystemConfig& config)
42  {
43  if (config.m_sysAlloc == nullptr)
44  config.m_sysAlloc = GeneratorSysAllocMalloc::InitSystemSingleton();
45 
46  // Init the BaseSystem
47  BaseSystem::Init(config);
48  if (BaseSystem::IsInitialized() == false)
49  return;
50 
51  // Register gwnavgeneration.lib specific Blobs.
52  // This is not done in BaseSystem::Init() because BaseSystem::Init() is part of gwnavruntime.lib,
53  // and gwnavgeneration.lib depend on gwnavruntime.lib.
54  GeneratorCategoryBuilder generatorCategoryBuilder;
55  BlobRegistry::AddCategory(&generatorCategoryBuilder);
56  }
57 
59  static bool IsInitialized() { return BaseSystem::IsInitialized(); }
60 
63  static bool HasMemoryLeaks() { return BaseSystem::HasMemoryLeaks(); }
64 
66  static void Destroy() { BaseSystem::Destroy(); }
67 };
68 
69 } // namespace Kaim
70 
71 
The BaseSystemConfig class contains a set of objects and configuration parameters that are required i...
Definition: basesystem.h:40
GeneratorBaseSystem()
Creates and sets up the new BaseSystem with a default configuration.
Definition: generatorbasesystem.h:28
static void Init(BaseSystemConfig &config)
Initialize.
Definition: generatorbasesystem.h:41
BaseSystemConfig Config
Defines a type for the configuration object used to initialize the GeneratorBaseSystem.
Definition: generatorbasesystem.h:24
static bool HasMemoryLeaks()
Indicates whether or not any memory allocated by the BaseSystem remains to be freed.
Definition: basesystem.h:133
static void Destroy()
Destroys the BaseSystem.
Definition: basesystem.cpp:133
static bool IsInitialized()
Indicates whether or not the BaseSystem has been successfully initialized.
Definition: generatorbasesystem.h:59
static bool HasMemoryLeaks()
Indicates whether or not any memory allocated by the GeneratorBaseSystem remains to be freed...
Definition: generatorbasesystem.h:63
The GeneratorBaseSystem class is a helper tool that enable the user to correctly initialize the BaseS...
Definition: generatorbasesystem.h:21
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
~GeneratorBaseSystem()
Calls static function GeneratorBaseSystem::Destroy()
Definition: generatorbasesystem.h:38
static void Init(const Config &config)
Sets up the BaseSystem according to the specified configuration.
Definition: basesystem.h:122
SysAllocBase * m_sysAlloc
Provides an instance of a class that implements the SysAlloc interface, which will be invoked any tim...
Definition: basesystem.h:81
static bool IsInitialized()
Indicates whether or not the BaseSystem has been successfully initialized.
Definition: basesystem.h:129
GeneratorBaseSystem(BaseSystemConfig &config)
Creates and sets up the BaseSystem according to the specified configuration.
Definition: generatorbasesystem.h:35
static void Destroy()
Destroys the GeneratorBaseSystem.
Definition: generatorbasesystem.h:66