Pepper_47_C++_interfaces
Public Member Functions | Static Public Member Functions | List of all members
pp::NetworkList Class Reference

#include <network_list.h>

Inheritance diagram for pp::NetworkList:
Inheritance graph
Collaboration diagram for pp::NetworkList:
Collaboration graph

Public Member Functions

 NetworkList ()
 
 NetworkList (PassRef, PP_Resource resource)
 
uint32_t GetCount () const
 
std::string GetName (uint32_t index) const
 
PP_NetworkList_Type GetType (uint32_t index) const
 
PP_NetworkList_State GetState (uint32_t index) const
 
int32_t GetIpAddresses (uint32_t index, std::vector< NetAddress > *addresses) const
 
std::string GetDisplayName (uint32_t index) const
 
uint32_t GetMTU (uint32_t index) const
 
- Public Member Functions inherited from pp::Resource
 Resource ()
 The default constructor. More...
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor. More...
 
Resourceoperator= (const Resource &other)
 
bool is_null () const
 
PP_Resource pp_resource () const
 
PP_Resource detach ()
 

Static Public Member Functions

static bool IsAvailable ()
 Returns true if the required interface is available. More...
 

Additional Inherited Members

- Protected Member Functions inherited from pp::Resource
 Resource (PP_Resource resource)
 
 Resource (PassRef, PP_Resource resource)
 
void PassRefFromConstructor (PP_Resource resource)
 
void Clear ()
 Sets this resource to null. This releases ownership of the resource. More...
 

Detailed Description

Definition at line 19 of file network_list.h.

Constructor & Destructor Documentation

pp::NetworkList::NetworkList ( )

Definition at line 24 of file network_list.cc.

pp::NetworkList::NetworkList ( PassRef  ,
PP_Resource  resource 
)

Definition at line 27 of file network_list.cc.

Member Function Documentation

uint32_t pp::NetworkList::GetCount ( ) const
Returns
Returns the number of available network interfaces or 0 if the list has never been updated.

Definition at line 36 of file network_list.cc.

References pp::Resource::pp_resource().

std::string pp::NetworkList::GetDisplayName ( uint32_t  index) const
Returns
Returns the display name for the network interface with the specified index.

Definition at line 78 of file network_list.cc.

References pp::Var::AsString(), pp::Var::is_string(), pp::PASS_REF, and pp::Resource::pp_resource().

int32_t pp::NetworkList::GetIpAddresses ( uint32_t  index,
std::vector< NetAddress > *  addresses 
) const

Gets the list of IP addresses for the network interface with the specified index and stores them in addresses.

Definition at line 65 of file network_list.cc.

References pp::ArrayOutputAdapterBase::pp_array_output(), and pp::Resource::pp_resource().

uint32_t pp::NetworkList::GetMTU ( uint32_t  index) const
Returns
Returns the MTU for the network interface with the specified index.

Definition at line 87 of file network_list.cc.

References pp::Resource::pp_resource().

std::string pp::NetworkList::GetName ( uint32_t  index) const
Returns
Returns the name for the network interface with the specified index.

Definition at line 42 of file network_list.cc.

References pp::Var::AsString(), pp::Var::is_string(), pp::PASS_REF, and pp::Resource::pp_resource().

PP_NetworkList_State pp::NetworkList::GetState ( uint32_t  index) const
Returns
Returns the current state of the network interface with the specified index.

Definition at line 58 of file network_list.cc.

References pp::Resource::pp_resource().

PP_NetworkList_Type pp::NetworkList::GetType ( uint32_t  index) const
Returns
Returns the type of the network interface with the specified index.

Definition at line 51 of file network_list.cc.

References pp::Resource::pp_resource().

bool pp::NetworkList::IsAvailable ( )
static

Returns true if the required interface is available.

Definition at line 32 of file network_list.cc.


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