1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __I_ATTRIBUTES_H_INCLUDED__
\r
6 #define __I_ATTRIBUTES_H_INCLUDED__
\r
8 #include "IReferenceCounted.h"
\r
10 #include "vector3d.h"
\r
11 #include "vector2d.h"
\r
14 #include "triangle3d.h"
\r
15 #include "position2d.h"
\r
17 #include "dimension2d.h"
\r
18 #include "matrix4.h"
\r
19 #include "quaternion.h"
\r
20 #include "plane3d.h"
\r
21 #include "triangle3d.h"
\r
24 #include "irrString.h"
\r
25 #include "irrArray.h"
\r
26 #include "EAttributes.h"
\r
34 } // end namespace video
\r
38 //! Provides a generic interface for attributes and their values and the possibility to serialize them
\r
39 class IAttributes : public virtual IReferenceCounted
\r
43 //! Returns amount of attributes in this collection of attributes.
\r
44 virtual u32 getAttributeCount() const = 0;
\r
46 //! Returns attribute name by index.
\r
47 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
48 virtual const c8* getAttributeName(s32 index) const = 0;
\r
50 //! Returns the type of an attribute
\r
51 //! \param attributeName: Name for the attribute
\r
52 virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) const = 0;
\r
54 //! Returns attribute type by index.
\r
55 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
56 virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) const = 0;
\r
58 //! Returns the type string of the attribute
\r
59 //! \param attributeName: String for the attribute type
\r
60 //! \param defaultNotFound Value returned when attributeName was not found
\r
61 virtual const wchar_t* getAttributeTypeString(const c8* attributeName, const wchar_t* defaultNotFound = L"unknown") const = 0;
\r
63 //! Returns the type string of the attribute by index.
\r
64 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
65 //! \param defaultNotFound Value returned for an invalid index
\r
66 virtual const wchar_t* getAttributeTypeString(s32 index, const wchar_t* defaultNotFound = L"unknown") const = 0;
\r
68 //! Returns if an attribute with a name exists
\r
69 virtual bool existsAttribute(const c8* attributeName) const = 0;
\r
71 //! Returns attribute index from name, -1 if not found
\r
72 virtual s32 findAttribute(const c8* attributeName) const = 0;
\r
74 //! Removes all attributes
\r
75 virtual void clear() = 0;
\r
84 //! Adds an attribute as integer
\r
85 virtual void addInt(const c8* attributeName, s32 value) = 0;
\r
87 //! Sets an attribute as integer value
\r
88 virtual void setAttribute(const c8* attributeName, s32 value) = 0;
\r
90 //! Gets an attribute as integer value
\r
91 //! \param attributeName: Name of the attribute to get.
\r
92 //! \param defaultNotFound Value returned when attributeName was not found
\r
93 //! \return Returns value of the attribute previously set by setAttribute()
\r
94 virtual s32 getAttributeAsInt(const c8* attributeName, irr::s32 defaultNotFound=0) const = 0;
\r
96 //! Gets an attribute as integer value
\r
97 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
98 virtual s32 getAttributeAsInt(s32 index) const = 0;
\r
100 //! Sets an attribute as integer value
\r
101 virtual void setAttribute(s32 index, s32 value) = 0;
\r
109 //! Adds an attribute as float
\r
110 virtual void addFloat(const c8* attributeName, f32 value) = 0;
\r
112 //! Sets a attribute as float value
\r
113 virtual void setAttribute(const c8* attributeName, f32 value) = 0;
\r
115 //! Gets an attribute as float value
\r
116 //! \param attributeName: Name of the attribute to get.
\r
117 //! \param defaultNotFound Value returned when attributeName was not found
\r
118 //! \return Returns value of the attribute previously set by setAttribute()
\r
119 virtual f32 getAttributeAsFloat(const c8* attributeName, irr::f32 defaultNotFound=0.f) const = 0;
\r
121 //! Gets an attribute as float value
\r
122 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
123 virtual f32 getAttributeAsFloat(s32 index) const = 0;
\r
125 //! Sets an attribute as float value
\r
126 virtual void setAttribute(s32 index, f32 value) = 0;
\r
133 //! Adds an attribute as bool
\r
134 virtual void addBool(const c8* attributeName, bool value) = 0;
\r
136 //! Sets an attribute as boolean value
\r
137 virtual void setAttribute(const c8* attributeName, bool value) = 0;
\r
139 //! Gets an attribute as boolean value
\r
140 //! \param attributeName: Name of the attribute to get.
\r
141 //! \param defaultNotFound Value returned when attributeName was not found
\r
142 //! \return Returns value of the attribute previously set by setAttribute()
\r
143 virtual bool getAttributeAsBool(const c8* attributeName, bool defaultNotFound=false) const = 0;
\r
145 //! Gets an attribute as boolean value
\r
146 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
147 virtual bool getAttributeAsBool(s32 index) const = 0;
\r
149 //! Sets an attribute as boolean value
\r
150 virtual void setAttribute(s32 index, bool value) = 0;
\r
154 } // end namespace io
\r
155 } // end namespace irr
\r