Public Member Functions | |
CAddressImpl (const CAddressImpl &rhs) | |
CAddressImpl & | operator= (const CAddressImpl &rhs) |
void | CopyFrom (const sockaddr &address, int size) |
Copies from the supplied address into this CAddressImpl's storage. | |
bool | WeOwnOnlyReference () const |
unsigned short | Family () const override |
Returns the address family of the address. | |
const sockaddr & | AsSockAddr () const override |
Returns the address as a reference to a sockaddr structure. | |
int | Size () const override |
Returns the size of the sockaddr structure required to store the address. | |
IAddressRef * | GetAddressRef () const override |
Returns a reference counted view on this address, be sure to call Release() on the IAdressRef when you're done with it. | |
sockaddr * | GetStorage () override |
Returns a pointer to a writable area of memory, represented as a socaddr structure, that is GetSize() bytes long. | |
int * | GetSize () override |
Returns a writable integer that contains the size of storage (in bytes) available for the address. You can then use the writable pointer to update this value to the amount of storage actually used. Typically one would copy the address into the memory returned by GetStorage() and then update the size used to the correct value by writing to the value returned from this function. Note that GetSize() will always return the maximum available storage, if you need to know the storage used then call IAddress.Size(). Calling GetSize() resets the size used to the maximum size available. Bleugh, but written so that this works: getsockname(socket, address.GetStorage(), address.GetSize()) . | |
IWritableAddressRef * | GetWritableAddressRef () const override |
Returns a reference counted view on this address, be sure to call Release() on the IWritableAddressRef when you're done with it. | |
bool | IsWildcardAddress () const override |
void | AddRef () override |
void | Release () override |
When the last reference is released the CAddressImpl will delete itself. | |
Static Public Member Functions | |
static CAddressImpl * | CreateAddress () |
Creates an empty instance of a CAddressImpl object that doesn't contain any address. Remember to Release() the object when done. | |
static CAddressImpl * | CreateAddress (const sockaddr &address, int size) |
Creates a CAddressImpl that represents the supplied address. Remember to Release() the object when done. | |
static bool | IsValid (const IAddress &address) |
static bool | IsSameAddress (const IAddress &lhs, const IAddress &rhs) |
static bool | IsValid (const IAddress &address) |
static bool | IsSameAddress (const IAddress &lhs, const IAddress &rhs) |
CAddressImpl | ( | const CAddressImpl & | rhs | ) |
CAddressImpl& operator= | ( | const CAddressImpl & | rhs | ) |
CAddressImpl * CreateAddress | ( | ) | [static] |
Creates an empty instance of a CAddressImpl object that doesn't contain any address. Remember to Release() the object when done.
CAddressImpl * CreateAddress | ( | const sockaddr & | address, | |
int | size | |||
) | [static] |
Creates a CAddressImpl that represents the supplied address. Remember to Release() the object when done.
void CopyFrom | ( | const sockaddr & | address, | |
int | size | |||
) |
Copies from the supplied address into this CAddressImpl's storage.
bool WeOwnOnlyReference | ( | ) | const |
unsigned short Family | ( | ) | const [override, virtual] |
const sockaddr & AsSockAddr | ( | ) | const [override, virtual] |
int Size | ( | ) | const [override, virtual] |
IAddressRef * GetAddressRef | ( | ) | const [override, virtual] |
sockaddr * GetStorage | ( | ) | [override, virtual] |
Returns a pointer to a writable area of memory, represented as a socaddr structure, that is GetSize() bytes long.
Implements IWritableAddress.
int * GetSize | ( | ) | [override, virtual] |
Returns a writable integer that contains the size of storage (in bytes) available for the address. You can then use the writable pointer to update this value to the amount of storage actually used. Typically one would copy the address into the memory returned by GetStorage() and then update the size used to the correct value by writing to the value returned from this function. Note that GetSize() will always return the maximum available storage, if you need to know the storage used then call IAddress.Size(). Calling GetSize() resets the size used to the maximum size available. Bleugh, but written so that this works: getsockname(socket, address.GetStorage(), address.GetSize())
.
Implements IWritableAddress.
IWritableAddressRef * GetWritableAddressRef | ( | ) | const [override, virtual] |
Returns a reference counted view on this address, be sure to call Release() on the IWritableAddressRef when you're done with it.
Implements IWritableAddress.
void AddRef | ( | ) | [override, virtual] |
Implements IAddressRef.
void Release | ( | ) | [override, virtual] |