//////////////////////////////////////////////////////////////////////////////////////////////////// // NoesisGUI - http://www.noesisengine.com // Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved. //////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef __GUI_BOXEDFREEZABLECOLLECTION_H__ #define __GUI_BOXEDFREEZABLECOLLECTION_H__ #include #include #include #include namespace Noesis { //////////////////////////////////////////////////////////////////////////////////////////////////// /// Represents a collection of boxed objects (doubles, Points, ...). /// BoxedFreezableCollection is itself an Animatable type. //////////////////////////////////////////////////////////////////////////////////////////////////// template class BoxedFreezableCollection: public BaseFreezableCollection { public: static_assert(!IsDerived::Result, "T can't inherit from BaseComponent"); /// Gets the element at the specified index inline const typename Param::Type Get(uint32_t index) const; /// Sets the element at the specified index inline void Set(uint32_t index, const typename Param::Type item); /// Adds an item to the collection. Returns The position into which the new element was /// inserted, or -1 to indicate that the item was not inserted into the collection inline int Add(const typename Param::Type item); /// Inserts an item to the collection at the specified index inline void Insert(uint32_t index, const typename Param::Type item); /// Determines whether the collection contains a specific value inline bool Contains(const typename Param::Type item) const; /// Determines the index of a specific item in the collection. Returns -1 if not found inline int IndexOf(const typename Param::Type item) const; /// Removes the first occurrence of a specific object from the collection. Returns true if item /// was removed, false to indicate that the item was not found in the collection inline bool Remove(const typename Param::Type item); // Hides Freezable methods for convenience //@{ Ptr> Clone() const; Ptr> CloneCurrentValue() const; //@} protected: inline const TypeClass* GetItemType() const final; inline Ptr CreateInstanceCore() const override; NS_IMPLEMENT_INLINE_REFLECTION_(BoxedFreezableCollection, BaseFreezableCollection, IdOf(IdOf(), "Collection")) }; } #include #endif