Array of fixed size.
More...
#include "Imagine/Common.h"
|
typedef const T * | const_iterator |
| Const iterator type.
|
|
typedef T * | iterator |
| Iterator type.
|
|
|
T | _data [S] |
| internal storage.
|
|
template<typename T, int S>
class Imagine::FArray< T, S >
Fixed size arrays.
- Parameters
-
- Examples
- Common/test/test.cpp, and Graphics/test/test.cpp.
◆ FArray() [1/7]
template<typename T , int S>
Constructs an uninitialized array of S variables of type T
Array of fixed size.
Definition: FArray.h:17
◆ FArray() [2/7]
template<typename T , int S>
Constructs an array of S variables of type T, each initialized to v
- Parameters
-
v | value used for initialization |
◆ FArray() [3/7]
template<typename T , int S>
template<typename T2 >
Constructs from a C array (with a possibly different type)
- Parameters
-
t | C array used for initialization |
- Template Parameters
-
◆ FArray() [4/7]
template<typename T , int S>
template<typename T2 >
Constructs from another FArray (with a possibly different type)
- Parameters
-
a | FArray to be copied (has to be of the same size) |
- Template Parameters
-
◆ FArray() [5/7]
template<typename T , int S>
Short constructor for 2D FArray
- Parameters
-
v0 | value for index 0 component |
v1 | value for index 1 component |
◆ FArray() [6/7]
template<typename T , int S>
Short constructor for 3D FArray
- Parameters
-
v0 | value for index 0 component |
v1 | value for index 1 component |
v2 | value for index 2 component |
◆ FArray() [7/7]
template<typename T , int S>
Short constructor for 4D FArray
- Parameters
-
v0 | value for index 0 component |
v1 | value for index 1 component |
v2 | value for index 2 component |
v3 | value for index 3 component |
◆ begin() [1/2]
template<typename T , int S>
Begin iterator
T * iterator
Iterator type.
Definition: FArray.h:25
*it='x';
◆ begin() [2/2]
template<typename T , int S>
Begin const iterator
const T * const_iterator
Const iterator type.
Definition: FArray.h:27
cout << *cit << endl;
◆ copy() [1/2]
template<typename T , int S>
template<typename T2 >
Copies another FArray of possibly different type but same size.
- Parameters
-
b | C array to be copied into FArray |
- Template Parameters
-
- Returns
- self reference
◆ copy() [2/2]
template<typename T , int S>
template<typename T2 >
Copies C array of different type
- Parameters
-
t | C array to be copied into FArray |
- Template Parameters
-
- Returns
- self reference
- Examples
- Common/test/test.cpp.
◆ data() [1/2]
template<typename T , int S>
Pointer to data for writing
- Returns
- pointer to FArray elements
◆ data() [2/2]
template<typename T , int S>
◆ empty()
template<typename T , int S>
True if FArray is empty
- Returns
- false
◆ end() [1/2]
template<typename T , int S>
◆ end() [2/2]
template<typename T , int S>
◆ fill()
template<typename T , int S>
Fills with constant value
- Parameters
-
v | value to be copied to each element |
- Returns
- self reference
- Examples
- Common/test/test.cpp.
◆ operator!=()
template<typename T , int S>
Inequality test (component wise)
- Parameters
-
- Returns
- true if *this is different from b
◆ operator=()
template<typename T , int S>
template<typename T2 >
Assigns from another FArray of possibly different type but same size
- Parameters
-
- Template Parameters
-
- Returns
- self reference
◆ operator==()
template<typename T , int S>
Equality test (component wise)
- Parameters
-
- Returns
- true if *this equals b
if (a==b) cout << "a equals b" << endl;
◆ operator[]() [1/2]
template<typename T , int S>
Writes ith element
- Parameters
-
i | element index (from 0 to S-1) |
- Returns
- Reference to ith element.
◆ operator[]() [2/2]
template<typename T , int S>
Reads ith element
- Parameters
-
i | element index (from 0 to S-1) |
- Returns
- const reference to ith element.
◆ size()
template<typename T , int S>
◆ operator<<
template<typename T , int S>
std::ostream & operator<< |
( |
std::ostream & |
out, |
|
|
const FArray< T, S > & |
a |
|
) |
| |
|
friend |
Writes FArray to stream
- Parameters
-
out | output stream |
a | FArray to write |
- Returns
- updated stream
out.open("tmp.txt");
out << a << endl;
◆ operator>>
template<typename T , int S>
std::istream & operator>> |
( |
std::istream & |
in, |
|
|
FArray< T, S > & |
a |
|
) |
| |
|
friend |
Reads FArray from stream
- Parameters
-
in | input stream |
a | FArray to read |
- Returns
- updated stream
in.open("tmp.txt");
in >> a;
◆ range
template<typename T , int S>
std::pair< T, T > range |
( |
const FArray< T, S > & |
a | ) |
|
|
friend |
Compute min and max of component values (provided comparisons are defined for type T)
- Parameters
-
- Returns
- pair of min,max values
friend std::pair< T, T > range(const FArray &a)
Range.
Definition: FArray.h:251
◆ read
template<typename T , int S>
void read |
( |
std::istream & |
in, |
|
|
FArray< T, S > & |
a |
|
) |
| |
|
friend |
Reads FArray from binary stream
- Parameters
-
in | input stream |
a | FArray to read |
ifstream in("tmp.bin",ios::binary);
friend void read(std::istream &in, FArray &a)
Binary read.
Definition: FArray.h:280
◆ write
template<typename T , int S>
void write |
( |
std::ostream & |
out, |
|
|
const FArray< T, S > & |
a |
|
) |
| |
|
friend |
Writes FArray to binary stream
- Parameters
-
out | output stream |
a | FArray to write |
ofstream out("tmp.bin",ios::binary);
friend void write(std::ostream &out, const FArray &a)
Binary write.
Definition: FArray.h:269
The documentation for this class was generated from the following file:
- C:/Users/Pascal Monasse/ImagineQt/Imagine/Common/src/Imagine/Common/FArray.h