3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
cList< TYPE, CONTAINER > Class Template Reference

The array template, refer it as coat::list <...> if you are using the Core API. More...

#include <cList.h>

Classes

struct  CompareFunctor
 

Public Types

typedef TYPE value_type
 
typedef CONTAINER container_type
 
typedef cList< TYPE, cList_Container< TYPE > > Ctor
 
typedef int Compare(const TYPE *, const TYPE *)
 
typedef bool Equals(const TYPE *, const TYPE *)
 
typedef TYPE * iterator
 

Public Member Functions

iterator begin ()
 
iterator end ()
 
iterator begin () const
 
iterator end () const
 
 cList (const cList< TYPE, CONTAINER > &Src)
 
 cList (const TYPE *Src, const int Count)
 
 cList (const int Count)
 
 cList (const int Count, const TYPE &Fill)
 
size_t Size () const
 
size_t SizeCapacity () const
 
void Copy (const cList< TYPE, CONTAINER > &Src)
 
void Copy (const TYPE *Src, const int Count)
 
void Move (cList< TYPE, CONTAINER > &Dest)
 
bool Move (int from, int to)
 
void CopyTo (cList< TYPE, CONTAINER > &Dest)
 
void Set (cList< TYPE, CONTAINER > *Src)
 
void operator= (const cList< TYPE, CONTAINER > &Src)
 
void Swap (cList< TYPE, CONTAINER > *With)
 
template<class Reader >
void FromBS (Reader &BS, int count)
 
template<class Writer >
void ToBS (Writer &BS)
 
const TYPE & operator[] (const int Index) const
 
TYPE & operator[] (const int Index)
 
const TYPE & GetAt (const int Index) const
 
TYPE & GetAt (const int Index)
 
const TYPE & GetFirst () const
 
TYPE & GetFirst ()
 
const TYPE & GetLast () const
 
TYPE & GetLast ()
 
void SetAt (const int Index, const TYPE &Value)
 
const TYPE * ToPtr () const
 
TYPE * ToPtr ()
 
void GetRange (const int Index, const int Count, cList< TYPE, CONTAINER > *To) const
 
TYPE uGet (const int Index, const TYPE &defvalue)
 Unlimited get - get value at index Index, if beyoud range - return defvalue.
 
void uSet (const int Index, const TYPE &value, const TYPE &defvalue)
 Unlimited set - set value at index Index, if beyoud range - add correcsponding count of defvalue-s.
 
TYPE * operator+ (int Index)
 
void Free ()
 
void FreeUnused ()
 
void FreeContents ()
 
template<int mod = 8>
void SetCapacityMod ()
 
int Count () const
 
int GetAmount () const
 
void SetCount (const int Count)
 
void SetCount (int Count, const TYPE &Value)
 
int Capacity () const
 
void SetCapacity (const int Capacity)
 
bool IsEmpty () const
 
void Clear ()
 
void Fill (const TYPE &Value)
 
int Add (const TYPE &Value, const int Count=1)
 
void AddValues (const TYPE *Values, int N)
 
template<class array >
void AddRange (const array &Src)
 
void AddRange (const TYPE *Src, const int Count)
 
void Insert (const int Index, const TYPE &Value, const int Count=1)
 
void InsertRange (const int Index, const cList< TYPE, CONTAINER > &Src)
 
void InsertRange (const int Index, const TYPE *Src, const int Count)
 
TYPE & ExpandTo (int Index, const TYPE &)
 
bool InsertFirstOrRemove (const TYPE &)
 
bool Remove (const TYPE &Value, Equals *E=(Equals *)&cList_DefEquals)
 
void RemoveAt (const int Index, const int Count=1)
 
void RemoveLast ()
 
int IndexOf (const TYPE &Value, Equals *E=(Equals *)&cList_DefEquals) const
 
int IndexOf (const TYPE &Value, const int StartIndex, Equals *E=(Equals *)&cList_DefEquals) const
 
int IndexOf (const TYPE &Value, const int StartIndex, const int Count, Equals *E=(Equals *)&cList_DefEquals) const
 
int LastIndexOf (const TYPE &Value, Equals *E=(Equals *)&cList_DefEquals) const
 
int LastIndexOf (const TYPE &Value, const int StartIndex, Equals *E=(Equals *)&cList_DefEquals) const
 
int LastIndexOf (const TYPE &Value, const int StartIndex, const int Count, Equals *E=(Equals *)&cList_DefEquals) const
 
int BinarySearch (const TYPE &Value, Compare *C=(Compare *)&cList_DefCompare) const
 
int BinarySearch (const int Index, const int Count, const TYPE &Value, Compare *C=(Compare *)&cList_DefCompare) const
 
bool Contains (const TYPE &Value, Equals *E=(Equals *)&cList_DefEquals) const
 
int find (const TYPE &Value) const
 
TYPE pop_front ()
 
TYPE pop_back ()
 
int AddUnique (const TYPE &Value, Equals *E=(Equals *)&cList_DefEquals)
 
bool AddOnce (const TYPE &, Equals *E=(Equals *)&cList_DefEquals)
 
void Reverse ()
 
void Reverse (const int Index, const int Count)
 
void Sort (Compare *C=(Compare *)&cList_DefCompare)
 
void Sort (const CompareFunctor &)
 
void Sort (const int Index, const int Count, Compare *C=(Compare *)&cList_DefCompare)
 
void Sort (int Index, int Count, const CompareFunctor &)
 
void EnsureCapacity (int size)
 
void operator+= (const TYPE &)
 
void operator-= (const TYPE &)
 
void operator*= (const TYPE &)
 
void operator/= (const TYPE &)
 
bool operator== (const cList< TYPE, CONTAINER > &) const
 
bool operator!= (const cList< TYPE, CONTAINER > &) const
 
bool some (::std::function< bool(const TYPE &)>) const
 js - like functions
 
bool some (::std::function< bool(TYPE &)>)
 
bool every (::std::function< bool(const TYPE &)>) const
 every returns true if all callbacks returned true
 
bool every (::std::function< bool(TYPE &)>)
 
int find (::std::function< bool(const TYPE &)>) const
 find returns index of the element if some of callbacks returns true or returns -1
 
int find (::std::function< bool(TYPE &)>)
 
void forEach (::std::function< void(const TYPE &)>) const
 execute callback for each element
 
void forEach (::std::function< void(TYPE &)>)
 
void filter (cList< TYPE, CONTAINER > &result, ::std::function< bool(const TYPE &)>) const
 filter returns new array with elements that passed the check
 
void filter (cList< TYPE, CONTAINER > &result, ::std::function< bool(TYPE &)>)
 
template<class RES >
void reduce (RES &res, ::std::function< void(RES &, const TYPE &)> fn) const
 reduce - sort of summ of all elements
 
template<class RES >
void reduce (RES &res, ::std::function< void(RES &, TYPE &)> fn)
 

Protected Member Functions

void Null ()
 
CONTAINER * EnsureCapacity (const int Capacity, const bool SkipDelete)
 
CONTAINER * Resize (const int Capacity, const bool SkipDelete)
 

Protected Attributes

CONTAINER * m_Container
 

Friends

class cXml
 

Detailed Description

template<class TYPE, class CONTAINER = cList_Container<TYPE>>
class cList< TYPE, CONTAINER >

The array template, refer it as coat::list <...> if you are using the Core API.

Template Parameters
TYPEthe type of elements
CONTAINERthe container type, use the default one

Member Function Documentation

◆ some()

template<class TYPE , class CONTAINER >
bool cList< TYPE, CONTAINER >::some ( ::std::function< bool(const TYPE &)> fn) const
inline

js - like functions

some returns true if some of callbacks returns true


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