SourcePro® API Reference Guide

 
List of all members | Public Member Functions
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() (struct sockaddr *addr, RWSockLenType addrLen) const =0
 
virtual RWSockAddrBaseoperator() (struct sockaddr *addr, RWSockLenType addrLen, int type) const =0
 
virtual RWSockAddrBaseoperator() (const RWCString &str) 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

virtual RWSockAddrFactoryBase::~RWSockAddrFactoryBase ( )
virtual

Destroys self.

Member Function Documentation

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 RWSockAddrFactory, RWInetAddrFactory, and RWInet6AddrFactory.

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 RWSockAddrFactory, RWInetAddrFactory, and RWInet6AddrFactory.

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 RWSockAddrFactory, RWInetAddrFactory, and RWInet6AddrFactory.

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