From a2f6e54104917c51c2f33a50e5397bd5a9994185 Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 31 Mar 2016 20:15:38 +0200 Subject: [PATCH] Sdk/BaseComponent: Add GetMaxComponentIndex static method Former-commit-id: b3413066bcb5b9f7b7b84092a2645154ad6d8005 --- SDK/include/NDK/BaseComponent.hpp | 2 ++ SDK/include/NDK/BaseComponent.inl | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/SDK/include/NDK/BaseComponent.hpp b/SDK/include/NDK/BaseComponent.hpp index be738b737..5ec1d53b6 100644 --- a/SDK/include/NDK/BaseComponent.hpp +++ b/SDK/include/NDK/BaseComponent.hpp @@ -31,6 +31,8 @@ namespace Ndk ComponentIndex GetIndex() const; + inline static ComponentIndex GetMaxComponentIndex(); + BaseComponent& operator=(const BaseComponent&) = default; BaseComponent& operator=(BaseComponent&&) = default; diff --git a/SDK/include/NDK/BaseComponent.inl b/SDK/include/NDK/BaseComponent.inl index b8637b457..f6bd79578 100644 --- a/SDK/include/NDK/BaseComponent.inl +++ b/SDK/include/NDK/BaseComponent.inl @@ -2,6 +2,7 @@ // This file is part of the "Nazara Development Kit" // For conditions of distribution and use, see copyright notice in Prerequesites.hpp +#include #include namespace Ndk @@ -17,6 +18,11 @@ namespace Ndk return m_componentIndex; } + inline ComponentIndex BaseComponent::GetMaxComponentIndex() + { + return static_cast(s_entries.size()); + } + inline ComponentIndex BaseComponent::RegisterComponent(ComponentId id, Factory factoryFunc) { // Nous allons rajouter notre composant à la fin