TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Classes | Functions
NiSTL

Detailed Description

Classes

struct  tIUnknownHash
 IUnknown pointer hash. More...
 

Functions

template<typename T >
void clear_delete (T &t, bool bDeleteArray=false)
 Delete all pointers contained in a container. More...
 
template<typename T >
T::iterator erase_delete (T &container, typename T::iterator it, bool bDeleteArray=false)
 Erase the given iterator and delete the object contained. More...
 
template<typename T >
void clear_invalidate (T &t)
 Invalidate all pointers contained in a container. More...
 
template<typename T >
void clear_safe_invalidate (T &t)
 Invalidate all pointers contained in a container. More...
 
template<typename T >
T::iterator erase_invalidate (T &container, typename T::iterator it)
 Erase the given iterator and invalidate the object contained. More...
 
template<typename T , typename S >
map_erase (T &map, S it)
 Erase the specified iterator in map-type container. More...
 
template<typename T , typename U >
bool map_find_erase (T &container, U v)
 Erase a found object. More...
 
template<typename T , typename U >
bool find_erase (T &container, U v)
 Erase a found object. More...
 
template<typename T , typename U >
bool find_erase_invalidate (T &container, U v)
 Erase a found object and invalidate. More...
 
template<typename T , typename U >
bool find_erase_delete (T &container, U &v, bool bDeleteArray=false)
 Erase a found object and delete it. More...
 
template<typename MapT , typename KeyArgT , typename ValueArgT >
MapT::iterator map_insert (MapT &m, const KeyArgT &k, const ValueArgT &v)
 Insert/add or update/set map component. More...
 
template<typename MapT , typename KeyArgT , typename ValueArgT >
MapT::iterator hmap_insert (MapT &m, const KeyArgT &k, const ValueArgT &v)
 Insert/add or update/set hash map component. More...
 
template<typename T , typename U >
bool push_back_once (T &container, U &v)
 Push back an object in a container only if it's not already in the container. More...
 
template<typename T , typename U >
bool push_front_once (T &container, U &v)
 Push front an object in a container only if it's not already in the container. More...
 
template<typename T >
ni::tSize iterator_index (T &v, niTypename T::iterator it)
 Get the index of the given iterator. More...
 
template<class T >
ni::tSize const_iterator_index (const T &v, niTypename T::const_iterator it)
 Get the index of the given iterator. More...
 
template<class T >
ni::tSize reverse_iterator_index (T &v, niTypename T::reverse_iterator it)
 Get the index of the given reverse_iterator. More...
 
template<class T >
ni::tSize const_reverse_iterator_index (const T &v, niTypename T::const_reverse_iterator it)
 Get the index of the given const_reverse_iterator. More...
 
template<typename T >
niTypename T::iterator iterator_at (const T &v, ni::tU32 anIndex)
 Get the iterator at the specified index using the ++ operator. More...
 
template<typename T >
niTypename T::const_iterator const_iterator_at (const T &v, ni::tU32 anIndex)
 Get the constant iterator at the specified index using the ++ operator. More...
 
template<typename T , typename U >
bool map_contains (const T &container, const U &v)
 Check whether the specified map contains the specified key. More...
 
template<typename T , typename U >
bool contains (const T &container, const U &v)
 Check whether the specified container contains the specified value. (based on astl::find) More...
 
template<typename D , typename S >
void copy_vector (D &d, const S &s)
 Vector-type container copy (clear, resize, for each it -> d[i] = s[i]) More...
 
template<typename D , typename S >
void memcopy_vector (D &d, const S &s)
 Vector-type container mem copy (clear, resize, memcpy(d,s)) More...
 
template<typename D , typename S >
void copy_list (D &d, const S &s)
 List-type container copy (clear, no reserve, for each it -> d.push_back(s[i])) More...
 
template<typename D , typename S >
void copy_set (D &d, const S &s)
 Set-type container copy (clear, for each it in s -> s.insert(*it)) More...
 
template<typename D , typename S >
void copy_map (D &d, const S &s)
 Map-type container copy (clear, for each it -> d.insert(it->first,it->second)) More...
 
template<typename D , typename S >
void copy_hmap (D &d, const S &s)
 HMap-type container copy (clear, for each it -> d.insert(it->first,it->second)) More...
 

Function Documentation

void astl::clear_delete ( T &  t,
bool  bDeleteArray = false 
)

Delete all pointers contained in a container.

T::iterator astl::erase_delete ( T &  container,
typename T::iterator  it,
bool  bDeleteArray = false 
)

Erase the given iterator and delete the object contained.

void astl::clear_invalidate ( T &  t)

Invalidate all pointers contained in a container.

void astl::clear_safe_invalidate ( T &  t)

Invalidate all pointers contained in a container.

T::iterator astl::erase_invalidate ( T &  container,
typename T::iterator  it 
)

Erase the given iterator and invalidate the object contained.

S astl::map_erase ( T &  map,
it 
)

Erase the specified iterator in map-type container.

bool astl::map_find_erase ( T &  container,
v 
)

Erase a found object.

bool astl::find_erase ( T &  container,
v 
)

Erase a found object.

bool astl::find_erase_invalidate ( T &  container,
v 
)

Erase a found object and invalidate.

bool astl::find_erase_delete ( T &  container,
U &  v,
bool  bDeleteArray = false 
)

Erase a found object and delete it.

MapT::iterator astl::map_insert ( MapT &  m,
const KeyArgT &  k,
const ValueArgT &  v 
)

Insert/add or update/set map component.

MapT::iterator astl::hmap_insert ( MapT &  m,
const KeyArgT &  k,
const ValueArgT &  v 
)

Insert/add or update/set hash map component.

bool astl::push_back_once ( T &  container,
U &  v 
)

Push back an object in a container only if it's not already in the container.

Returns
false if the object was already in the container, true if not and that the object has been added.
bool astl::push_front_once ( T &  container,
U &  v 
)

Push front an object in a container only if it's not already in the container.

Returns
false if the object was already in the container, true if not and that the object has been added.
ni::tSize astl::iterator_index ( T &  v,
niTypename T::iterator  it 
)

Get the index of the given iterator.

Remarks
This works only for vectors.
ni::tSize astl::const_iterator_index ( const T &  v,
niTypename T::const_iterator  it 
)

Get the index of the given iterator.

Remarks
This works only for vectors.
ni::tSize astl::reverse_iterator_index ( T &  v,
niTypename T::reverse_iterator  it 
)

Get the index of the given reverse_iterator.

Remarks
This works only for vectors.
ni::tSize astl::const_reverse_iterator_index ( const T &  v,
niTypename T::const_reverse_iterator  it 
)

Get the index of the given const_reverse_iterator.

Remarks
This works only for vectors.
niTypename T::iterator astl::iterator_at ( const T &  v,
ni::tU32  anIndex 
)

Get the iterator at the specified index using the ++ operator.

niTypename T::const_iterator astl::const_iterator_at ( const T &  v,
ni::tU32  anIndex 
)

Get the constant iterator at the specified index using the ++ operator.

bool astl::map_contains ( const T &  container,
const U &  v 
)

Check whether the specified map contains the specified key.

bool astl::contains ( const T &  container,
const U &  v 
)

Check whether the specified container contains the specified value. (based on astl::find)

void astl::copy_vector ( D &  d,
const S &  s 
)

Vector-type container copy (clear, resize, for each it -> d[i] = s[i])

void astl::memcopy_vector ( D &  d,
const S &  s 
)

Vector-type container mem copy (clear, resize, memcpy(d,s))

void astl::copy_list ( D &  d,
const S &  s 
)

List-type container copy (clear, no reserve, for each it -> d.push_back(s[i]))

Remarks
This could be used with deque containers
void astl::copy_set ( D &  d,
const S &  s 
)

Set-type container copy (clear, for each it in s -> s.insert(*it))

Remarks
This can be used with hash_set containers
void astl::copy_map ( D &  d,
const S &  s 
)

Map-type container copy (clear, for each it -> d.insert(it->first,it->second))

void astl::copy_hmap ( D &  d,
const S &  s 
)

HMap-type container copy (clear, for each it -> d.insert(it->first,it->second))