SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWSockAddrFactoryBase Class Referenceabstract

Abstract class that builds socket addresses. More...

#include <rw/network/RWSockAddrFactoryBase.h>

Inheritance diagram for RWSockAddrFactoryBase:
RWInet6AddrFactory RWInetAddrFactory RWSockAddrFactory

Public Member Functions

virtual ~RWSockAddrFactoryBase ()
 
virtual RWSockAddrBaseoperator() (const RWCString &str) const =0
 
virtual RWSockAddrBaseoperator() (struct sockaddr *addr, RWSockLenType addrLen) const =0
 
virtual RWSockAddrBaseoperator() (struct sockaddr *addr, RWSockLenType addrLen, int type) const =0
 

Detailed Description

RWSockAddrFactoryBase is an abstract class that builds socket addresses. It represents the concept of an object that can build socket addresses from either an input string or from the C API representation.

Constructor & Destructor Documentation

◆ ~RWSockAddrFactoryBase()

virtual RWSockAddrFactoryBase::~RWSockAddrFactoryBase ( )
virtual

Destroys self.

Member Function Documentation

◆ operator()() [1/3]

virtual RWSockAddrBase * RWSockAddrFactoryBase::operator() ( const RWCString & str) const
pure virtual

Returns a pointer to an RWSockAddrBase derived object constructed from the provided RWCString.

The newly created RWSockAddrBase is allocated on the heap. The caller is responsible for deleting it. Often, this is managed by wrapping the object using an RWSockAddr.

Implemented in RWInet6AddrFactory, RWInetAddrFactory, and RWSockAddrFactory.

◆ operator()() [2/3]

virtual RWSockAddrBase * RWSockAddrFactoryBase::operator() ( struct sockaddr * addr,
RWSockLenType addrLen ) const
pure virtual

Returns a pointer to an RWSockAddrBase derived object constructed from the provided sockaddr.

The addr parameter is expected to point to a concrete socket address type appropriate for this factory. For instance, a factory for creating RWInetAddr instances would expect addr to be a pointer to sockaddr_in.

The addrLen parameter is expected to describe the size, in bytes, of the object pointed to by addr.

The newly created RWSockAddrBase is allocated on the heap. The caller is responsible for deleting it. Often, this is managed by wrapping the object using an RWSockAddr.

Implemented in RWInet6AddrFactory, RWInetAddrFactory, and RWSockAddrFactory.

◆ operator()() [3/3]

virtual RWSockAddrBase * RWSockAddrFactoryBase::operator() ( struct sockaddr * addr,
RWSockLenType addrLen,
int type ) const
pure virtual

Returns a pointer to an RWSockAddrBase derived object constructed from the provided sockaddr.

The addr parameter is expected to point to a concrete socket address type appropriate for this factory. For instance, a factory for creating RWInetAddr instances would expect addr to be a pointer to sockaddr_in.

The addrLen parameter is expected to describe the size, in bytes, of the object pointed to by addr.

The type parameter describes the type of socket address to be created. This would normally be one of SOCK_STREAM or SOCK_DGRAM.

The newly created RWSockAddrBase is allocated on the heap. The caller is responsible for deleting it. Often, this is managed by wrapping the object using an RWSockAddr.

Implemented in RWInet6AddrFactory, RWInetAddrFactory, and RWSockAddrFactory.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.