Cavestory Mod API
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CaveNet::DataStructures::NetClientVector Class Reference

Stores multiple clients. More...

#include <CaveNet_ExportedTypes.h>

Public Types

typedef NetClient ** iterator
 The iterator for NetClientVector.
 

Public Member Functions

 NetClientVector ()
 Constructor.
 
 ~NetClientVector ()
 Deconstructor.
 
bool Add (NetClient *client)
 Add a client into this vector. More...
 
bool Remove (NetClient *client)
 Remove a client from this vector. More...
 
bool Remove (NetClient **itr)
 Remove a client from this vector. More...
 
void Clear ()
 Clear the vector.
 
void FreeClients ()
 Clear the vector, whilst also freeing all clients.
 
void Shrink ()
 Shrink the vector down to fit the current amount of clients in it.
 
int Count ()
 Get the number of clients in the vector. More...
 
int Size ()
 Get the size of the vector. More...
 
NetClientoperator[] (int index)
 Array operator – Returns a net client at the given index. More...
 
NetClientoperator[] (int index) const
 Array operator – Returns a net client at the given index. More...
 
NetClientfirst ()
 Get the first entry. More...
 
NetClientlast ()
 Get the last entry. More...
 
NetClient ** begin ()
 Get the first iterator entry. More...
 
NetClient ** end ()
 Get the last iterator entry. More...
 

Protected Member Functions

void Resize (int newSize)
 Resize the vector. More...
 

Protected Attributes

NetClient ** mList
 
int mCount
 
int mSize
 

Friends

class NetClient
 Friends with NetClient because that's what we'll be storing.
 

Detailed Description

Stores multiple clients.

Member Function Documentation

◆ Add()

bool CaveNet::DataStructures::NetClientVector::Add ( NetClient client)

Add a client into this vector.

Parameters
clientThe client object to add.
Returns
bool Returns true if the client was added to the vector.

◆ begin()

NetClient** CaveNet::DataStructures::NetClientVector::begin ( )

Get the first iterator entry.

Returns
Returns the first iterator entry

◆ Count()

int CaveNet::DataStructures::NetClientVector::Count ( )

Get the number of clients in the vector.

Returns
int Returns the amount of clients currently in the vector.

◆ end()

NetClient** CaveNet::DataStructures::NetClientVector::end ( )

Get the last iterator entry.

Returns
Returns the last iterator entry

◆ first()

NetClient* CaveNet::DataStructures::NetClientVector::first ( )

Get the first entry.

Returns
Returns the first entry

◆ last()

NetClient* CaveNet::DataStructures::NetClientVector::last ( )

Get the last entry.

Returns
Returns the last entry

◆ operator[]() [1/2]

NetClient* CaveNet::DataStructures::NetClientVector::operator[] ( int  index)

Array operator – Returns a net client at the given index.

Parameters
indexThe index of the client

◆ operator[]() [2/2]

NetClient* CaveNet::DataStructures::NetClientVector::operator[] ( int  index) const

Array operator – Returns a net client at the given index.

Parameters
indexThe index of the client

◆ Remove() [1/2]

bool CaveNet::DataStructures::NetClientVector::Remove ( NetClient **  itr)

Remove a client from this vector.

Parameters
itrThe client pointer to remove.
Returns
bool Returns true if the client was removed from the vector.

◆ Remove() [2/2]

bool CaveNet::DataStructures::NetClientVector::Remove ( NetClient client)

Remove a client from this vector.

Parameters
clientThe client object to remove.
Returns
bool Returns true if the client was removed from the vector.

◆ Resize()

void CaveNet::DataStructures::NetClientVector::Resize ( int  newSize)
protected

Resize the vector.

Parameters
sizeThe new size of the vector.

◆ Size()

int CaveNet::DataStructures::NetClientVector::Size ( )

Get the size of the vector.

Returns
int Returns the size of the vector.

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