Skip to content

SaraTamer/SNVector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

<title>SNVector: SNVector< T > Class Template Reference</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script>
SNVector
<script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ var searchBox = new SearchBox("searchBox", "search/",'.html'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */ </script>
Loading...
Searching...
No Matches

Public Member Functions

 SNVector (int num=2)
 constructor More...
 
 SNVector (T *arr, int n)
 constructor More...
 
 SNVector (const SNVector &vector)
 copy constructor More...
 
 ~SNVector ()
 Destructor. More...
 
SNVectoroperator= (const SNVector &vector)
 copy assignment More...
 
SNVectoroperator= (SNVector &&vector) noexcept
 move assignment More...
 
T & operator[] (int)
 overloading random access operator to access SNVector items by reference More...
 
int push_back (T)
 add item in the end of SNVector More...
 
pop_back ()
 to delete the last item in SNVector More...
 
void erase (iterator)
 to delete item at certain index from SNVector More...
 
void erase (iterator1, iterator2)
 to delete range of items from SNVector More...
 
void clear ()
 Delete all SNVector content. More...
 
void insert (iterator, T item)
 to insert item of type Template in certain index More...
 
iterator begin ()
 Getter of address to the first item. More...
 
iterator end ()
 Getter of address to the last item. More...
 
bool operator== (const SNVector< T > &vector)
 overloading of the comparing operator More...
 
bool operator< (const SNVector< T > &vector)
 overloading to the less than operator, Compares item by item More...
 
int Size ()
 Size Getter. More...
 
int Capacity ()
 Capacity Getter. More...
 
int resize ()
 Relocate to bigger space. More...
 
bool empty ()
 chech the size of the SNVector More...
 

Private Types

typedef T * iterator
 
typedef T * iterator1
 
typedef T * iterator2
 

Private Attributes

int size
 
int capacity
 
T * vec
 

Friends

ostream & operator (ostream &out, SNVector< T > vector)
 

Constructor & Destructor Documentation

◆ SNVector() [1/3]

template<class T >
SNVector< T >::SNVector ( int  num = 2)

constructor

Template Parameters
T
Parameters
num

◆ SNVector() [2/3]

template<class T >
SNVector< T >::SNVector ( T *  arr,
int  n 
)

constructor

Template Parameters
T
Parameters
arr
n

◆ SNVector() [3/3]

template<class T >
SNVector< T >::SNVector ( const SNVector< T > &  vector)

copy constructor

Template Parameters
T
Parameters
vector

◆ ~SNVector()

template<class T >
SNVector< T >::~SNVector

Destructor.

Template Parameters
T

Member Function Documentation

◆ begin()

template<class T >
T * SNVector< T >::begin

Getter of address to the first item.

Template Parameters
T
Returns
pointer to the first item in SNVector

◆ Capacity()

template<class T >
int SNVector< T >::Capacity

Capacity Getter.

Template Parameters
T
Returns
Capacity of SNVector

◆ clear()

template<class T >
void SNVector< T >::clear

Delete all SNVector content.

Template Parameters
T

◆ empty()

template<class T >
bool SNVector< T >::empty

chech the size of the SNVector

Template Parameters
T
Returns
0 is the vector is empty

◆ end()

template<class T >
T * SNVector< T >::end

Getter of address to the last item.

Template Parameters
T
Returns
pointer to the first item in SNVector

◆ erase() [1/2]

template<class T >
void SNVector< T >::erase ( iterator  iter)

to delete item at certain index from SNVector

Template Parameters
T
Parameters
iterpointer to the address we want to delete

◆ erase() [2/2]

template<class T >
void SNVector< T >::erase ( iterator1  i1,
iterator2  i2 
)

to delete range of items from SNVector

Template Parameters
T
Parameters
i1the lower boundary of the range
i2the upper boundary of the range

◆ insert()

template<class T >
void SNVector< T >::insert ( iterator  iter,
item 
)

to insert item of type Template in certain index

Template Parameters
T
Parameters
iterpointer to the index to insert in
itemof type Template to insert in SNVector

◆ operator<()

template<class T >
bool SNVector< T >::operator< ( const SNVector< T > &  vector)

overloading to the less than operator, Compares item by item

Template Parameters
T
Parameters
vector
Returns
true if first different item in this is < in other

◆ operator=() [1/2]

template<class T >
SNVector< T > & SNVector< T >::operator= ( const SNVector< T > &  vector)

copy assignment

Template Parameters
T
Parameters
vector
Returns
SNVector

◆ operator=() [2/2]

template<class T >
SNVector< T > & SNVector< T >::operator= ( SNVector< T > &&  vector)
noexcept

move assignment

Template Parameters
T
Parameters
vector
Returns
SNVector

◆ operator==()

template<class T >
bool SNVector< T >::operator== ( const SNVector< T > &  vector)

overloading of the comparing operator

Template Parameters
T
Parameters
vector
Returns
true if ==

◆ operator[]()

template<class T >
T & SNVector< T >::operator[] ( int  index)

overloading random access operator to access SNVector items by reference

Template Parameters
T
Parameters
index
Returns
the item accessed of Template type

◆ pop_back()

template<class T >
T SNVector< T >::pop_back

to delete the last item in SNVector

Template Parameters
T
Returns
the last new item of type Template

◆ push_back()

template<class T >
int SNVector< T >::push_back ( item)

add item in the end of SNVector

Template Parameters
T
Parameters
item
Returns
the new size of the vector

◆ resize()

template<class T >
int SNVector< T >::resize

Relocate to bigger space.

Template Parameters
T
Returns
the new capacity of SNVector

◆ Size()

template<class T >
int SNVector< T >::Size

Size Getter.

Template Parameters
T
Returns
size of SNVector

The documentation for this class was generated from the following files:
  • C:/Users/Apex/CLionProjects/SNVector/SNVector.h
  • C:/Users/Apex/CLionProjects/SNVector/SNVector.cpp

Generated by doxygen 1.9.5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%