This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Vector Class

Header:#include <UnigineVector.h>

A vector container template.

Warning
In UnigineScript, a vector is a sequence container which represents an array of flexible size. See Containers article for the details.

Vector Class

Members


void set(int index, const Type & t)

Set an item by index.

Arguments

  • int index - Item index.
  • const Type & t - Item to set.

Type & get(int index)

Return an item by index.

Arguments

  • int index - Item index.

Return value

The item.

const Type & get(int index) const

Return an constant item by index.

Arguments

  • int index - Item index.

Return value

The item.

Type * get()

Return the pointer to the vector.

Return value

The vector.

const Type * get() const

Return the constant pointer to the vector.

Return value

The vector.

void allocate(int size)

Allocates a vector.

Arguments

  • int size - Size of allocated items.

void append(const Type & t)

Appends an item.

Arguments

  • const Type & t - Item.

void append(int pos, const Type & t)

Appends an item at position.

Arguments

  • int pos - Position.
  • const Type & t - Item.

void append(const Vector< Type > & v)

Appends a vector.

Arguments

  • const Vector< Type > & v - Vector.

void append(const Type * v, int size)

Appends a vector.

Arguments

  • const Type * v - Vector pointer.
  • int size - Vector size.

Iterator back()

Returns the back iterator.

Return value

Back iterator.

ConstIterator back() const

Returns the back iterator.

Return value

Back iterator.

Iterator begin()

Returns the begin iterator.

Return value

Begin iterator.

ConstIterator begin() const

Returns the begin iterator.

Return value

Begin iterator.

void clear()

Clears the vector.

void destroy()

Destroys the vector.

int empty() const

Returns the 1 if the vector is empty; otherwise, 0 is returned.

Return value

The empty flag.

Iterator end()

Returns the end iterator.

Return value

End iterator.

ConstIterator end() const

Returns the end iterator.

Return value

End iterator.

Iterator find(const T & t)

Finds an item in the vector.

Arguments

  • const T & t - Item.

Return value

The iterator.

ConstIterator find(const T & t) const

Finds an item in the vector.

Arguments

  • const T & t - Item.

Return value

The const iterator.

int findIndex(const T & t) const

Finds an item in the vector.

Arguments

  • const T & t - Item.

Return value

The item number.

int leftIndex(const T & t) const

Finds an item with lower value.

Arguments

  • const T & t - Item.

Return value

The item number.

Vector< Type > & operator=(const Vector< Type > & v)

Assignment operator for the vector.

Arguments

  • const Vector< Type > & v - Vector.

Type & operator[](int index)

Vector access.

Arguments

  • int index - Array item index.

Return value

The vector item.

const Type & operator[](int index) const

Constant vector access.

Arguments

  • int index - Array item index.

Return value

The vector item.

void remove()

Removes the last item.

void remove(int pos, int size)

Removes an item at position.

Arguments

  • int pos - Position.
  • int size - The number of items to remove.

void remove(const Iterator & it)

Removes an item at position.

Arguments

  • const Iterator & it - The iterator.

void removeFast(int pos)

Removes an item at position.

Arguments

  • int pos - Position.

void removeFast(const Iterator & it)

Removes an item at position.

Arguments

  • const Iterator & it - The iterator.

void reserve(int size)

Reserves a vector.

Arguments

  • int size - Size of reserves items.

void resize(int size)

Resizes a vector.

Arguments

  • int size - Size of vector.

int rightIndex(const T & t) const

Finds an item with greater value.

Arguments

  • const T & t - Item.

Return value

The item number.

int size() const

Returns the size of the vector.

Return value

The size of the vector.

int space() const

Returns the internal size of the vector.

Return value

The internal size of the vector.

Vector()

Default constructor that produces an empty vector.

Vector(const Vector< Type > & v)

Copy constructor.

Arguments

  • const Vector< Type > & v - Vector.

Vector(const Type & t, int size)

Constructor that produces a vector with specified size and initialization.

Arguments

  • const Type & t - Item value.
  • int size - Vector size.

Vector(const Type * v, int size)

Copy constructor that produces a vector with specified size.

Arguments

  • const Type * v - Vector pointer.
  • int size - Vector size.

explicit Vector(int size)

Explicit constructor that produces a vector with specified size.

Arguments

  • int size - Vector size.

~Vector()

Destructor.
Last update: 2017-07-03
Build: ()