Ignore:
Timestamp:
02/14/13 18:21:47 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented the client support for the new commands and updated the basic test programs with tests showing messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/Exception.h

    r19 r40  
    143143        INVALID_ID = 7,
    144144
     145        /// Invalid duration
     146        INVALID_DURATION = 8,
     147
    145148        /// Other error
    146149        OTHER = 255
     
    153156    errorCode_t errorCode;
    154157
     158    /**
     159     * Indicate if the parameter is valid.
     160     */
     161    bool hasParameter;
     162
     163    /**
     164     * Parameter of the error.
     165     */
     166    long parameter;
     167
    155168public:
    156169    /**
    157170     * Construct the exception.
    158171     */
    159     ProtocolException(errorCode_t errorCode) throw();
     172    ProtocolException(errorCode_t errorCode,
     173                      bool hasParameter = false, long parameter = 0) throw();
    160174
    161175    /**
     
    163177     */
    164178    errorCode_t getErrorCode() const throw();
     179
     180    /**
     181     * Get the value of the parameter and whether it is valid or not.
     182     */
     183    bool getParameter(long& param) const throw();
    165184};
    166185
     
    246265{
    247266    return errorCode;
     267}
     268
     269//------------------------------------------------------------------------------
     270
     271inline bool ProtocolException::getParameter(long& param) const throw()
     272{
     273    if (hasParameter) param = parameter;
     274    return hasParameter;
    248275}
    249276
Note: See TracChangeset for help on using the changeset viewer.