Lodestone.Core
Loading...
Searching...
No Matches
lodestone::core::Lodestone Class Reference

The core Lodestone class, used for registering other plugin libs. More...

#include <Lodestone.h>

Collaboration diagram for lodestone::core::Lodestone:

Public Member Functions

void registerExtension (LodestoneExtension *ext)
bool hasExtension (const common::registry::Identifier &id) const
LodestoneExtension * getExtension (const common::registry::Identifier &id)
const map_t< common::registry::Identifier, LodestoneExtension * > & getExtensions ()
version::VersionRegistry & getVersionRegistry ()

Static Public Member Functions

static Lodestone * getInstance ()

Private Attributes

map_t< common::registry::Identifier, LodestoneExtension * > m_extensions
version::VersionRegistry m_versionRegistry

Detailed Description

The core Lodestone class, used for registering other plugin libs.

Member Function Documentation

◆ getExtension()

LodestoneExtension * lodestone::core::Lodestone::getExtension ( const common::registry::Identifier & id)
30 {
31 if (const auto it = m_extensions.find(id); it != m_extensions.end())
32 return it->second;
33
34 return nullptr;
35 }
map_t< common::registry::Identifier, LodestoneExtension * > m_extensions
Definition Lodestone.h:29

◆ getExtensions()

const map_t< common::registry::Identifier, LodestoneExtension * > & lodestone::core::Lodestone::getExtensions ( )
38 {
39 return m_extensions;
40 }

◆ getInstance()

Lodestone * lodestone::core::Lodestone::getInstance ( )
static
11 {
12 static Lodestone s_instance;
13 return &s_instance;
14 }

◆ getVersionRegistry()

version::VersionRegistry & lodestone::core::Lodestone::getVersionRegistry ( )
42 {
43 return this->m_versionRegistry;
44 }
version::VersionRegistry m_versionRegistry
Definition Lodestone.h:31

◆ hasExtension()

bool lodestone::core::Lodestone::hasExtension ( const common::registry::Identifier & id) const
25 {
26 return m_extensions.contains(id);
27 }

◆ registerExtension()

void lodestone::core::Lodestone::registerExtension ( LodestoneExtension * ext)
16 {
17 common::registry::Identifier id = ext->getIdentifier();
18 if (hasExtension(id))
19 throw std::runtime_error(
20 "Tried to register extension with id that already exists.");
21
22 m_extensions.emplace(id, ext);
23 }
bool hasExtension(const common::registry::Identifier &id) const
Definition Lodestone.cpp:25

Member Data Documentation

◆ m_extensions

map_t<common::registry::Identifier, LodestoneExtension *> lodestone::core::Lodestone::m_extensions
private

◆ m_versionRegistry

version::VersionRegistry lodestone::core::Lodestone::m_versionRegistry
private

The documentation for this class was generated from the following files: