AFI
Advanced Forwarding Interface
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
AftDataIP4Addr Class Reference

Data class for IPv4 addresses. More...

#include <AftData.h>

Inheritance diagram for AftDataIP4Addr:
AftData

Public Types

typedef std::shared_ptr
< AftDataIP4Addr
Ptr
 Pointer type for all AftData IPv4 addresses.
 

Public Member Functions

 AftDataIP4Addr (uint32_t newAddress, uint32_t newBitLength)
 Constructor for IPv4 address. More...
 
 AftDataIP4Addr (std::string prefixString)
 Constructor for IPv4 address. More...
 
const uint32_t value () const
 
virtual uint32_t append (AftDataBytes &aData)
 Append contents of data object to AftDataBytes vector. More...
 
virtual const std::string dataClass () const
 
virtual std::ostream & description (std::ostream &os) const
 Append a description of the data to an output stream. More...
 
virtual int compare (const AftData &aData) const
 Compare data. More...
 
- Public Member Functions inherited from AftData
 AftData (uint32_t newBitLength)
 Base constructor for data objects. More...
 
const uint32_t bitLength () const
 
const uint32_t byteLength () const
 
bool operator== (const AftData &aData) const
 Comparator for data. More...
 

Static Public Member Functions

static AftDataIP4Addr::Ptr create (uint32_t newAddress, uint32_t newBitLength)
 Factory generator for IPv4 address. More...
 
static AftDataIP4Addr::Ptr create (std::string prefixString)
 Factory generator for IPv4 address. More...
 

Protected Attributes

uint32_t _value
 Encapsulated IPv4 Address.
 
- Protected Attributes inherited from AftData
uint32_t _bitLength
 Size of encapsulated data in bits.
 

Additional Inherited Members

- Protected Member Functions inherited from AftData
void setBitLength (uint32_t newBitLength)
 Set the bitlength of the data. More...
 

Detailed Description

Data class for IPv4 addresses.

Constructor & Destructor Documentation

AftDataIP4Addr::AftDataIP4Addr ( uint32_t  newAddress,
uint32_t  newBitLength 
)
inline

Constructor for IPv4 address.

Parameters
[in]newAddressIPv4 address to represent in data
[in]newBitLengthLength of IPv4 address in bits (i.e. subnet length)
AftDataIP4Addr::AftDataIP4Addr ( std::string  prefixString)
inline

Constructor for IPv4 address.

Parameters
[in]prefixStringIPv4 address as a dot-notation string to represent in data

Member Function Documentation

virtual uint32_t AftDataIP4Addr::append ( AftDataBytes newData)
inlinevirtual

Append contents of data object to AftDataBytes vector.

Parameters
[in]dataReference to AftDataBytes vector to append to

Reimplemented from AftData.

virtual int AftDataIP4Addr::compare ( const AftData aData) const
inlinevirtual

Compare data.

Parameters
[in]aDataReference to data to compare against
Returns
Zero if data is the same

Reimplemented from AftData.

static AftDataIP4Addr::Ptr AftDataIP4Addr::create ( uint32_t  newAddress,
uint32_t  newBitLength 
)
inlinestatic

Factory generator for IPv4 address.

Parameters
[in]newAddressIPv4 address to represent in data
[in]newBitLengthLength of IPv4 address in bits (i.e. subnet length)
static AftDataIP4Addr::Ptr AftDataIP4Addr::create ( std::string  prefixString)
inlinestatic

Factory generator for IPv4 address.

Parameters
[in]prefixStringIPv4 address as a dot-notation string to represent in data
virtual const std::string AftDataIP4Addr::dataClass ( ) const
inlinevirtual
Returns
String description of data type

Reimplemented from AftData.

virtual std::ostream& AftDataIP4Addr::description ( std::ostream &  os) const
inlinevirtual

Append a description of the data to an output stream.

Parameters
[in]osReference to output stream to append description to
Returns
Reference to output stream with text description of data appended

Reimplemented from AftData.

const uint32_t AftDataIP4Addr::value ( ) const
inline
Returns
Returns IPv4 address as a 32 bit value

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