# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CPSAttrib Class Template Reference

This class is intended to store an attribute list in a located or in a located bindable such as speed, color and so on. More...

#include <ps_attrib.h>

List of all members.

Public Types

Useful typedefs
typedef std::vector< T > TContType
 Container used by this class to store its datas. More...

typedef T value_type
 The type used by the container. Its is the type used to instanciate this template. More...

typedef TContType::iterator iterator
 an iterator on the datas. More...

typedef TContType::const_iterator const_iterator
 a const iterator on the datas. More...


Public Methods

Object
 CPSAttrib ()
 ctor. More...

void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 Serialization method. More...

Size of the container
void resize (uint32 nbInstances)
 Resize the attributes tab. More...

uint32 getSize (void) const
 return the number of instance in the container. More...

uint32 getMaxSize (void) const
 return the max number of instance in the container. More...

Element access.
const T & operator[] (uint32 index) const
 get a const reference on an attribute instance. More...

T & operator[] (uint32 index)
 get a reference on an attribute instance. More...

Iterator / enumeration
iterator begin (void)
 Get an iterator at the beginning of the container. More...

iterator end (void)
 Get an iterator at the end of the container. More...

const_iterator begin (void) const
 Get a const_iterator at the beginning of the container. More...

const_iterator end (void) const
 Get a const_iterator at the end of the container. More...

Add / remove methods
sint32 insert (const T &t=T())
 create a new object in the tab. More...

void remove (uint32 index)
 remove an object from the tab. More...

void clear (void)
 clear the container. More...


Protected Attributes

TContType _Tab
uint32 _MaxSize


Detailed Description

template<typename T>
class NL3D::CPSAttrib< T >

This class is intended to store an attribute list in a located or in a located bindable such as speed, color and so on.

It is important to remember that a located holds all instance of object of one type (force, emitter, particles or both...).

Author:
Nicolas Vizerie , Nevrax France
Date:
2001

Definition at line 233 of file ps_attrib.h.


Member Typedef Documentation

template<typename T>
typedef TContType::const_iterator NL3D::CPSAttrib::const_iterator
 

a const iterator on the datas.

Definition at line 260 of file ps_attrib.h.

Referenced by NL3D::CPSAttrib< sint32 >::begin, and NL3D::CPSAttrib< sint32 >::end.

template<typename T>
typedef TContType::iterator NL3D::CPSAttrib::iterator
 

an iterator on the datas.

Definition at line 258 of file ps_attrib.h.

Referenced by NL3D::CPSAttrib< sint32 >::begin, and NL3D::CPSAttrib< sint32 >::end.

template<typename T>
typedef std::vector<T> NL3D::CPSAttrib::TContType
 

Container used by this class to store its datas.

The container type is likely to change depending on memory requirement.

Definition at line 252 of file ps_attrib.h.

template<typename T>
typedef T NL3D::CPSAttrib::value_type
 

The type used by the container. Its is the type used to instanciate this template.

Definition at line 255 of file ps_attrib.h.


Constructor & Destructor Documentation

template<typename T>
NL3D::CPSAttrib< T >::CPSAttrib  
 

ctor.

Definition at line 352 of file ps_attrib.h.

References _MaxSize, and NL3D::DefaultMaxLocatedInstance.


Member Function Documentation

template<typename T>
const_iterator NL3D::CPSAttrib< T >::begin void    const [inline]
 

Get a const_iterator at the beginning of the container.

Definition at line 314 of file ps_attrib.h.

template<typename T>
iterator NL3D::CPSAttrib< T >::begin void    [inline]
 

Get an iterator at the beginning of the container.

Definition at line 308 of file ps_attrib.h.

template<typename T>
void NL3D::CPSAttrib< T >::clear void    [inline]
 

clear the container.

Definition at line 332 of file ps_attrib.h.

template<typename T>
const_iterator NL3D::CPSAttrib< T >::end void    const [inline]
 

Get a const_iterator at the end of the container.

Definition at line 317 of file ps_attrib.h.

template<typename T>
iterator NL3D::CPSAttrib< T >::end void    [inline]
 

Get an iterator at the end of the container.

Definition at line 311 of file ps_attrib.h.

template<typename T>
uint32 NL3D::CPSAttrib< T >::getMaxSize void    const [inline]
 

return the max number of instance in the container.

Definition at line 275 of file ps_attrib.h.

template<typename T>
uint32 NL3D::CPSAttrib< T >::getSize void    const [inline]
 

return the number of instance in the container.

Definition at line 272 of file ps_attrib.h.

template<typename T>
sint32 NL3D::CPSAttrib< T >::insert const T &    t = T()
 

create a new object in the tab.

It is append at the end of it

Returns:
the index if there were enough room for it or -1 else

Definition at line 368 of file ps_attrib.h.

References _MaxSize, _Tab, NL3D::DefaultMaxLocatedInstance, and t.

template<typename T>
T& NL3D::CPSAttrib< T >::operator[] uint32    index [inline]
 

get a reference on an attribute instance.

Definition at line 292 of file ps_attrib.h.

template<typename T>
const T& NL3D::CPSAttrib< T >::operator[] uint32    index const [inline]
 

get a const reference on an attribute instance.

Definition at line 283 of file ps_attrib.h.

template<typename T>
void NL3D::CPSAttrib< T >::remove uint32    index
 

remove an object from the tab.

Definition at line 380 of file ps_attrib.h.

References _Tab, index, and nlassert.

template<typename T>
void NL3D::CPSAttrib< T >::resize uint32    nbInstances
 

Resize the attributes tab.

This tells what is the max number of element in this tab, but don't add elements. The behaviour is much like std::vector::reserve

Definition at line 359 of file ps_attrib.h.

References _MaxSize, _Tab, and nlassert.

template<typename T>
void NL3D::CPSAttrib< T >::serial NLMISC::IStream   f throw (NLMISC::EStream)
 

Serialization method.

Definition at line 393 of file ps_attrib.h.

References nlassert.


Member Data Documentation

template<typename T>
uint32 NL3D::CPSAttrib::_MaxSize [protected]
 

Definition at line 340 of file ps_attrib.h.

Referenced by CPSAttrib, NL3D::CPSAttrib< sint32 >::getMaxSize, insert, and resize.

template<typename T>
TContType NL3D::CPSAttrib::_Tab [protected]
 

Definition at line 339 of file ps_attrib.h.

Referenced by NL3D::CPSAttrib< sint32 >::begin, NL3D::CPSAttrib< sint32 >::clear, NL3D::CPSAttrib< sint32 >::end, NL3D::CPSAttrib< sint32 >::getSize, insert, NL3D::CPSAttrib< sint32 >::operator[], remove, and resize.


The documentation for this class was generated from the following file: