Brunot
Loading...
Searching...
No Matches
th::Library Class Reference

#include <Library.h>

Public Member Functions

 Library ()=default
 ~Library ()=default
 Library (const Library &other)=delete
 Library (Library &&other) noexcept=delete
auto operator= (const Library &other) -> Library &=delete
auto operator= (Library &&other) noexcept -> Library &=delete
template<>
auto get (const std::string &name) -> GameObject *
 a template specialization for get<>() that returns the object to get as a pointer to a gameobject useful when you don't know or don't care about the type you're loading.

Static Public Member Functions

template<typename T>
static auto get (const std::string &name) -> T *
 get a pointer to an object in the library.
static auto flush () -> void
 remove objects from the library, this will break anything that uses its resources

Static Private Member Functions

static auto findObject (const std::string &name) -> AnySerializable *
 helper function, finds an object in the objects library, if it doesn't exist, it creates it
static auto addObject (const std::string &name) -> AnySerializable *
 adds an object that doesn't exist to the objects library

Static Private Attributes

static serializables_dictionary objects
 a static unordered map of objects in the library

Constructor & Destructor Documentation

◆ Library() [1/3]

th::Library::Library ( )
default
Here is the caller graph for this function:

◆ ~Library()

th::Library::~Library ( )
default

◆ Library() [2/3]

th::Library::Library ( const Library & other)
delete
Here is the call graph for this function:

◆ Library() [3/3]

th::Library::Library ( Library && other)
deletenoexcept
Here is the call graph for this function:

Member Function Documentation

◆ addObject()

auto th::Library::addObject ( const std::string & name) ->AnySerializable *
staticprivate

adds an object that doesn't exist to the objects library

add an object to the dictionary of objects, and return a pointer to it

Parameters
namethe name of the object to construct
Returns
a non-owning AnySerializable pointer to the newly constructed object
Parameters
namethe name of the object to load
Returns
a pointer to an AnySerializable with the object requested.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findObject()

auto th::Library::findObject ( const std::string & name) ->AnySerializable *
staticprivate

helper function, finds an object in the objects library, if it doesn't exist, it creates it

Parameters
namethe name of the object to find
Returns
a non-owning AnySerializable pointer to the data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush()

auto th::Library::flush ( ) ->void
static

remove objects from the library, this will break anything that uses its resources

Here is the caller graph for this function:

◆ get() [1/2]

template<>
auto th::Library::get ( const std::string & name) ->GameObject *
inline

a template specialization for get<>() that returns the object to get as a pointer to a gameobject useful when you don't know or don't care about the type you're loading.

be very careful using this, and make sure the thing you are loading is actually a gameobject

Parameters
namethe name of GameObject to load
Returns
a gameobject*
Here is the call graph for this function:

◆ get() [2/2]

template<typename T>
auto th::Library::get ( const std::string & name) ->T *
inlinestatic

get a pointer to an object in the library.

if it doesn't exist, it will create it

Template Parameters
Tthe type of the object to create
Parameters
namethe name of the object to create. Data/ gets prepended, and .json gets postpended
Returns
a raw (non-owning) pointer to the object owned by library
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

auto th::Library::operator= ( const Library & other) ->Library &=delete
delete
Here is the call graph for this function:

◆ operator=() [2/2]

auto th::Library::operator= ( Library && other) ->Library &=delete
deletenoexcept
Here is the call graph for this function:

Member Data Documentation

◆ objects

serializables_dictionary th::Library::objects
inlinestaticprivate

a static unordered map of objects in the library


The documentation for this class was generated from the following files:
  • /home/egrazil/sites/Brunot/The House/source/Framework/Library.h
  • /home/egrazil/sites/Brunot/The House/source/Framework/Library.cpp