Documentation for the rest
Former-commit-id: b6f401370127679db397da0039cb5e98477e90db
This commit is contained in:
@@ -7,6 +7,20 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \class Nz::ObjectRef
|
||||
* \brief Core class that represents a reference to an object
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Gets the ObjectRef object by name
|
||||
* \return Optional reference
|
||||
*
|
||||
* \param name Name of the object
|
||||
*
|
||||
* \remark Produces a NazaraError if object not found
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
ObjectRef<Type> ObjectLibrary<Type>::Get(const String& name)
|
||||
{
|
||||
@@ -17,18 +31,37 @@ namespace Nz
|
||||
return ref;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Checks whether the library has the object with that name
|
||||
* \return true if it the case
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
bool ObjectLibrary<Type>::Has(const String& name)
|
||||
{
|
||||
return Type::s_library.find(name) != Type::s_library.end();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Registers the ObjectRef object with that name
|
||||
*
|
||||
* \param name Name of the object
|
||||
* \param object Object to stock
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
void ObjectLibrary<Type>::Register(const String& name, ObjectRef<Type> object)
|
||||
{
|
||||
Type::s_library.emplace(name, object);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the ObjectRef object by name
|
||||
* \return Optional reference
|
||||
*
|
||||
* \param name Name of the object
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
ObjectRef<Type> ObjectLibrary<Type>::Query(const String& name)
|
||||
{
|
||||
@@ -39,6 +72,12 @@ namespace Nz
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Unregisters the ObjectRef object with that name
|
||||
*
|
||||
* \param name Name of the object
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
void ObjectLibrary<Type>::Unregister(const String& name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user