Savarese Software Research Corporation
BufferSizeError Class Reference

BufferSizeError is a container for a BufferTooShort or GroupTooShort errror, reporting the buffer size required for success. More...

#include <Error.h>

Inheritance diagram for BufferSizeError:
Inheritance graph
[legend]

Public Types

enum   Code {
  AcceptSession = ACCEPT_SESSION, IllegalSpread = ILLEGAL_SPREAD, CouldNotConnect = COULD_NOT_CONNECT, RejectQuota = REJECT_QUOTA,
  RejectNoName = REJECT_NO_NAME, RejectIllegalName = REJECT_ILLEGAL_NAME, RejectNotUnique = REJECT_NOT_UNIQUE, RejectVersion = REJECT_VERSION,
  ConnectionClosed = CONNECTION_CLOSED, RejectAuth = REJECT_AUTH, IllegalSession = ILLEGAL_SESSION, IllegalService = ILLEGAL_SERVICE,
  IllegalMessage = ILLEGAL_MESSAGE, IllegalGroup = ILLEGAL_GROUP, BufferTooShort = BUFFER_TOO_SHORT, GroupsTooShort = GROUPS_TOO_SHORT,
  MessageTooLong = MESSAGE_TOO_LONG
}
  Code is not a proper enumeration, but rather a specification of constants corresponding to Spread return and error codes. More...
 

Public Member Functions

  BufferSizeError (const int err, const unsigned int size)
  Creates a BufferSizeError instance with the specified error code and required buffer size. More...
 
unsigned int  size () const
  Returns the required buffer size for a successful retry. More...
 
int  error () const
  Returns the error code used to create the Error. More...
 
void  print () const
  Prints the message corresponding to the error via SP_error. More...
 

Detailed Description

BufferSizeError is a container for a BufferTooShort or GroupTooShort errror, reporting the buffer size required for success.

Only in a rare circumstance will this error be thrown by the library. In every expected situation the library handles the error itself by automatically resizing buffers and reattempting the operation or by truncating the buffer if so-specified by the user.

Definition at line 110 of file Error.h.

Member Enumeration Documentation

enum Error::Code
inherited

Code is not a proper enumeration, but rather a specification of constants corresponding to Spread return and error codes.

We do not document the meaning of these codes. See the Spread C API documentation to understand their meaning.

Enumerator
AcceptSession 
IllegalSpread 
CouldNotConnect 
RejectQuota 
RejectNoName 
RejectIllegalName 
RejectNotUnique 
RejectVersion 
ConnectionClosed 
RejectAuth 
IllegalSession 
IllegalService 
IllegalMessage 
IllegalGroup 
BufferTooShort 
GroupsTooShort 
MessageTooLong 

Definition at line 51 of file Error.h.

Constructor & Destructor Documentation

BufferSizeError::BufferSizeError ( const int  err,
const unsigned int  size 
)
inline

Creates a BufferSizeError instance with the specified error code and required buffer size.

Parameters
err The Spread error code.
size The required buffer size for a successful retry.

Definition at line 121 of file Error.h.

Member Function Documentation

int Error::error ( ) const
inlineinherited

Returns the error code used to create the Error.

Returns
The error code used to create the Error.

Definition at line 87 of file Error.h.

void Error::print ( ) const
inlineinherited

Prints the message corresponding to the error via SP_error.

We'd like to give you the message as a string, but the documented Spread C API does not provide such a facility.

Definition at line 96 of file Error.h.

unsigned int BufferSizeError::size ( ) const
inline

Returns the required buffer size for a successful retry.

Returns
The required buffer size for a successful retry.

Definition at line 129 of file Error.h.

References __END_NS_SSRC_SPREAD.


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

Savarese Software Research Corporation
Copyright © 2006-2015 Savarese Software Research Corporation. All rights reserved.