PIP 6.1.0
Platform-Independent Primitives
Loading...
Searching...
No Matches
PIEthernet::InterfaceList Class Reference

Collection of Interface descriptors with lookup helpers. More...

#include <piethernet.h>

Inheritance diagram for PIEthernet::InterfaceList:

Public Member Functions

const Interface * getByIndex (int index) const
 Returns interface with system index "index", or 0 if absent.
const Interface * getByName (const PIString &name) const
 Returns interface with system name "name", or 0 if absent.
const Interface * getByAddress (const PIString &address) const
 Returns interface with IP address "address", or 0 if absent.
const Interface * getLoopback () const
 Returns the loopback interface, or 0 if absent.
Public Member Functions inherited from PIVector< PIEthernet::Interface >
 PIVector ()
 Constructs an empty array.
PIVector< PIEthernet::Interface > & operator= (const PIVector< PIEthernet::Interface > &v)
 Assign operator.
iterator begin ()
 Iterator to the first element.
iterator end ()
 Iterator to the element following the last element.
reverse_iterator rbegin ()
 Returns a reverse iterator to the first element of the reversed array.
reverse_iterator rend ()
 Returns a reverse iterator to the element following the last element of the reversed array.
size_t size () const
 Number of elements in the container.
ssize_t size_s () const
 Number of elements in the container as signed value.
size_t length () const
 Same as size().
size_t capacity () const
 Number of elements that the container has currently allocated space for.
bool isEmpty () const
 Checks if the container has no elements.
bool isNotEmpty () const
 Checks if the container has elements.
bool any (std::function< bool(const PIEthernet::Interface &e)> test) const
 Tests whether at least one element in the array passes the test implemented by the provided function test.
bool every (std::function< bool(const PIEthernet::Interface &e)> test) const
 Tests whether all elements in the array passes the test implemented by the provided function test.
PIEthernet::Interface & operator[] (size_t index)
 Full access to element by index.
const PIEthernet::Interface & at (size_t index) const
 Read only access to element by index.
const PIEthernet::Interface & atWhere (std::function< bool(const PIEthernet::Interface &e)> test, ssize_t start=0, const PIEthernet::Interface &def=PIEthernet::Interface()) const
 Returns the first element of the array that passes the test implemented by the provided function test or def if there is no such element.
const PIEthernet::Interface & lastAtWhere (std::function< bool(const PIEthernet::Interface &e)> test, ssize_t start=-1, const PIEthernet::Interface &def=PIEthernet::Interface()) const
 Returns the last element of the array that passes the test implemented by the provided function test or def if there is no such element.
PIEthernet::Interface & back ()
 Last element.
PIEthernet::Interface & front ()
 Last element.
bool operator== (const PIVector< PIEthernet::Interface > &v) const
 Compare operator with array v.
bool operator!= (const PIVector< PIEthernet::Interface > &v) const
 Compare operator with array v.
bool contains (const PIEthernet::Interface &e, ssize_t start=0) const
 Tests if element e exists in the array.
bool containsAll (const PIVector< PIEthernet::Interface > &v, ssize_t start=0) const
 Tests if all elements of v exists in the array.
bool containsAny (const PIVector< PIEthernet::Interface > &v, ssize_t start=0) const
 Tests if any element of v exists in the array.
int entries (const PIEthernet::Interface &e, ssize_t start=0) const
 Count elements equal e in the array.
ssize_t indexOf (const PIEthernet::Interface &e, ssize_t start=0) const
 Returns the first index at which a given element e can be found in the array, or -1 if it is not present.
ssize_t indexWhere (std::function< bool(const PIEthernet::Interface &e)> test, ssize_t start=0) const
 Returns the first index passes the test implemented by the provided function test, or -1 if it is not present. can be found in the array, or -1 if it is not present.
ssize_t lastIndexOf (const PIEthernet::Interface &e, ssize_t start=-1) const
 Returns the last index at which a given element e can be found in the array, or -1 if it is not present.
ssize_t lastIndexWhere (std::function< bool(const PIEthernet::Interface &e)> test, ssize_t start=-1) const
 Returns the last index passes the test implemented by the provided function test, or -1 if it is not present.
PIEthernet::Interface * data (size_t index=0)
 Pointer to array.
PIVector< PIEthernet::Interface > getRange (size_t index, size_t count) const
 Creates sub-array of this array.
PIVector< PIEthernet::Interface > & clear ()
 Clear array, remove all elements.
PIVector< PIEthernet::Interface > & fill (const PIEthernet::Interface &e=PIEthernet::Interface())
 Assigns element 'e' to all items in the array.
PIVector< PIEthernet::Interface > & assign (const PIEthernet::Interface &e=PIEthernet::Interface())
 Same as fill().
PIVector< PIEthernet::Interface > & resize (size_t new_size, const PIEthernet::Interface &e=PIEthernet::Interface())
 Sets size of the array, new elements are copied from e.
PIVector< PIEthernet::Interface > & reserve (size_t new_size)
 Attempts to allocate memory for at least new_size elements.
PIVector< PIEthernet::Interface > & insert (size_t index, const PIEthernet::Interface &e=PIEthernet::Interface(), size_t count=1)
 Inserts value e at index position in the array.
PIVector< PIEthernet::Interface > & remove (size_t index, size_t count=1)
 Removes count elements from the middle of the array, starting at index position.
void swap (PIVector< PIEthernet::Interface > &v)
 Swaps array v other with this array.
PIVector< PIEthernet::Interface > & sort ()
 Sorts the elements in non-descending order.
PIVector< PIEthernet::Interface > & reverse ()
 Reverses this array.
PIVector< PIEthernet::Interface > reversed () const
 Returns reversed array.
PIVector< PIEthernet::Interface > & enlarge (ssize_t add_size, const PIEthernet::Interface &e=PIEthernet::Interface())
 Increases or decreases the size of the array by add_size elements.
PIVector< PIEthernet::Interface > & removeOne (const PIEthernet::Interface &e)
 Remove no more than one element equal e.
PIVector< PIEthernet::Interface > & removeAll (const PIEthernet::Interface &e)
 Remove all elements equal e.
PIVector< PIEthernet::Interface > & removeWhere (std::function< bool(const PIEthernet::Interface &e)> test)
 Remove all elements in the array passes the test implemented by the provided function test.
PIVector< PIEthernet::Interface > & push_back (const PIEthernet::Interface &e)
 Appends the given element e to the end of the array.
PIVector< PIEthernet::Interface > & append (const PIEthernet::Interface &e)
 Appends the given element e to the end of the array.
PIVector< PIEthernet::Interface > & operator<< (const PIEthernet::Interface &e)
 Appends the given element e to the end of the array.
PIVector< PIEthernet::Interface > & push_front (const PIEthernet::Interface &e)
 Appends the given element e to the begin of the array.
PIVector< PIEthernet::Interface > & prepend (const PIEthernet::Interface &e)
 Appends the given element e to the begin of the array.
PIVector< PIEthernet::Interface > & pop_back ()
 Remove one element from the end of the array.
PIVector< PIEthernet::Interface > & pop_front ()
 Remove one element from the begining of the array.
PIEthernet::Interface take_back ()
 Remove one element from the end of the array and return it.
PIEthernet::Interface take_front ()
 Remove one element from the begining of the array and return it.
PIVector< ST > toType () const
 Returns an array converted to another type.
PIVector< PIEthernet::Interface > filter (std::function< bool(const PIEthernet::Interface &e)> test) const
 Returns a new array with all elements that pass the test implemented by the provided function bool test(const T & e).
PIVector< PIEthernet::Interface > filterIndexed (std::function< bool(size_t index, const PIEthernet::Interface &e)> test) const
 Same as filter() but with index parameter in test.
PIVector< PIEthernet::Interface > filterReverse (std::function< bool(const PIEthernet::Interface &e)> test) const
 Same as filter() but from end to begin (from right to left).
PIVector< PIEthernet::Interface > filterReverseIndexed (std::function< bool(size_t index, const PIEthernet::Interface &e)> test) const
 Same as filterReverse() but with index parameter in test.
void forEach (std::function< void(const PIEthernet::Interface &e)> f) const
 Execute function void f(const T & e) for every element in array.
void forEachIndexed (std::function< void(size_t index, const PIEthernet::Interface &e)> f) const
 Same as forEach() but with index parameter in f.
void forEachReverse (std::function< void(const PIEthernet::Interface &e)> f) const
 Same as forEach() but from end to begin (from right to left).
void forEachReverseIndexed (std::function< void(size_t index, const PIEthernet::Interface &e)> f) const
 Same as forEachIndexed() but from end to begin (from right to left).
PIVector< ST > map (std::function< ST(const PIEthernet::Interface &e)> f) const
 Сreates a new array populated with the results of calling a provided function ST f(const T & e) on every element in the calling array.
PIVector< ST > mapIndexed (std::function< ST(size_t index, const PIEthernet::Interface &e)> f) const
 Same as map() but with index parameter in f.
PIVector< ST > mapReverse (std::function< ST(const PIEthernet::Interface &e)> f) const
 Same as map() but from end to begin (from right to left).
PIVector< ST > mapReverseIndexed (std::function< ST(size_t index, const PIEthernet::Interface &e)> f) const
 Same as mapReverse() but with index parameter in f.
ST reduce (std::function< ST(const PIEthernet::Interface &e, const ST &acc)> f, const ST &initial=ST()) const
 Applies the function ST f(const T & e, const ST & acc) to each element of the array (from left to right), returns one value.
ST reduceIndexed (std::function< ST(size_t index, const PIEthernet::Interface &e, const ST &acc)> f, const ST &initial=ST()) const
 Same as reduce() but with index parameter in f.
ST reduceReverse (std::function< ST(const PIEthernet::Interface &e, const ST &acc)> f, const ST &initial=ST()) const
 Same as reduce() but from end to begin (from right to left).
ST reduceReverseIndexed (std::function< ST(size_t index, const PIEthernet::Interface &e, const ST &acc)> f, const ST &initial=ST()) const
 Same as reduceReverse() but with index parameter in f.
PIVector< PIVector< PIEthernet::Interface > > reshape (size_t rows, size_t cols, ReshapeOrder order=ReshapeByRow) const
 Changes the dimension of the array, creates a two-dimensional array from a one-dimensional array.
PIVector< C > flatten (ReshapeOrder order=ReshapeByRow) const
 Changes the dimension of the array, creates a one-dimensional array from a two-dimensional array.
PIVector< PIVector< PIEthernet::Interface > > split (const PIEthernet::Interface &separator) const
 Divides an array into a two-dimensional array using the separator separator.
PIVector< PIVector< PIEthernet::Interface > > splitBySize (size_t sz) const
 Divides an array into a two-dimensional array in chunks of no more than sz.
PIVector< PIEthernet::Interface > takeRange (size_t index, size_t count)
 Cut sub-array of this array.

Detailed Description

Collection of Interface descriptors with lookup helpers.