Emergency 20 Dokumentation  4.2.0
em5::DiagnosisManager Class Reference

Manager for diagnosis definitions. More...

#include <DiagnosisManager.h>

Inheritance diagram for em5::DiagnosisManager:
qsf::ElementManager< uint32, Diagnosis > qsf::Manager

Public Member Functions

 DiagnosisManager ()
 Default constructor. More...
 
virtual ~DiagnosisManager ()
 Destructor. More...
 
void loadAssets ()
 Load definitions from assets. More...
 
bool saveByFilename (const std::string &filename)
 Save diagnosis JSON file. More...
 
const DiagnosisgetDiagnosisById (const qsf::StringHash &id) const
 Find diagnosis by ID. More...
 
- Public Member Functions inherited from qsf::ElementManager< uint32, Diagnosis >
 ElementManager ()
 Default constructor. More...
 
virtual ~ElementManager ()
 Destructor. More...
 
const ElementMapgetElements () const
 Return map of elements. More...
 
Diagnosis * findElement (const uint32 &key) const
 Find a specific element by its key in either the element map. More...
 
void reserveElements (size_t numberOfElements)
 Reserve elements. More...
 
Diagnosis * createElement ()
 Create a new element. More...
 
Diagnosis * createElementById (const uint32 &key)
 Create a new element with an enforced given unique element identifier. More...
 
bool insertElement (const uint32 &key, Diagnosis &element)
 Insert an element with an enforced given unique element identifier. More...
 
bool destroyElement (const uint32 &key)
 Destroy an element by its key. More...
 
ElementManager< uint32, Diagnosis, detail::DirectAllocator< Diagnosis >, ConsecutiveIdGenerator< uint32 > >::ElementMap::iterator destroyElement (typename ElementMap::iterator iterator)
 Destroy an element by iterator. More...
 
void destroyAllElements ()
 Destroy all elements. More...
 
Diagnosis * grabElement (const uint32 &key)
 Remove an element from the element manager without destroying it. More...
 
uint32 generateId ()
 Generate a new, unused key. More...
 

Additional Inherited Members

- Public Types inherited from qsf::ElementManager< uint32, Diagnosis >
typedef boost::container::flat_map< uint32, Diagnosis * > ElementMap
 
- Protected Member Functions inherited from qsf::ElementManager< uint32, Diagnosis >
ElementMapgetElementsWritable ()
 Return map of elements. More...
 
virtual void onElementInsertion (const uint32 &key, Diagnosis &element)
 Called whenever an element is inserted into the element map. More...
 
virtual void onElementRemoval (const uint32 &key, Diagnosis &element)
 Called whenever an element is actually going to be destroyed. More...
 
- Protected Member Functions inherited from qsf::Manager
 Manager ()
 Default constructor. More...
 
virtual ~Manager ()
 Destructor. More...
 

Detailed Description

Manager for diagnosis definitions.

Constructor & Destructor Documentation

em5::DiagnosisManager::DiagnosisManager ( )

Default constructor.

virtual em5::DiagnosisManager::~DiagnosisManager ( )
virtual

Destructor.

Member Function Documentation

const Diagnosis* em5::DiagnosisManager::getDiagnosisById ( const qsf::StringHash id) const

Find diagnosis by ID.

Parameters
[in]idID to search for
Returns
The diagnosis if there is one with the given ID, a null pointer otherwise; do not destroy the instance
void em5::DiagnosisManager::loadAssets ( )

Load definitions from assets.

bool em5::DiagnosisManager::saveByFilename ( const std::string &  filename)

Save diagnosis JSON file.

Parameters
[in]filenamePath of the file to save

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