Documentation for module 'NDK'
Former-commit-id: 63e1cac538c577a1f1aafa71fa7eef69a6d4daab [formerly b2d8769fd02a0e7d9c476d4ad7be1988a1fd6789] [formerly 636b5cb79bcb8da44d9aa45ba1023565bcf29f0d [formerly a2361ec2b8679d4d4ba096e543b5d4b91825dd62]] Former-commit-id: d402d35477f9db0135c553d55c401939426bf62d [formerly 607336ea0f42731e4604f3a8c2df06f3aecfc401] Former-commit-id: 69e23cd6c06723486de5e4641ce810012dac66da
This commit is contained in:
@@ -7,6 +7,18 @@
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
/*!
|
||||
* \ingroup NDK
|
||||
* \class Ndk::System<SystemType>
|
||||
* \brief NDK class that represents a system which interacts on a world
|
||||
*
|
||||
* \remark This class is meant to be derived as CRTP: "System<Subtype>"
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Constructs a System object by default
|
||||
*/
|
||||
|
||||
template<typename SystemType>
|
||||
System<SystemType>::System() :
|
||||
BaseSystem(GetSystemIndex<SystemType>())
|
||||
@@ -16,15 +28,26 @@ namespace Ndk
|
||||
template<typename SystemType>
|
||||
System<SystemType>::~System() = default;
|
||||
|
||||
/*!
|
||||
* \brief Clones the system
|
||||
* \return The clone newly created
|
||||
*
|
||||
* \remark The system to clone should be trivially copy constructible
|
||||
*/
|
||||
|
||||
template<typename SystemType>
|
||||
BaseSystem* System<SystemType>::Clone() const
|
||||
std::unique_ptr<BaseSystem> System<SystemType>::Clone() const
|
||||
{
|
||||
///FIXME: Pas encore supporté par GCC (4.9.2)
|
||||
///FIXME: Not fully supported in GCC (4.9.2)
|
||||
//static_assert(std::is_trivially_copy_constructible<SystemType>::value, "SystemType should be copy-constructible");
|
||||
|
||||
return new SystemType(static_cast<const SystemType&>(*this));
|
||||
return std::make_unique<SystemType>(static_cast<const SystemType&>(*this));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Registers the system by assigning it an index
|
||||
*/
|
||||
|
||||
template<typename SystemType>
|
||||
SystemIndex System<SystemType>::RegisterSystem()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user