// Copyright (C) 2010-2016  MarketFactory, Inc. All Rights Reserved.
//================================================================================
//   This file is auto-generated; DO NOT EDIT!
//================================================================================

#ifndef __MFAPIGEN_CANCELREJECTREASON__
#define __MFAPIGEN_CANCELREJECTREASON__

#include <iostream>

namespace MFAPI {

struct CancelRejectReason
{
    enum Type {
    TOO_LATE_TO_CANCEL = 0,
    UNKNOWN_ORDER = 1,
    DUPLICATE_CLORDID_RECEIVED = 6,
    INVALID_CANCEL = 11,
    OTHER = 12,
    ORDER_NOT_ACTIVE = 13,
    INVALID_FEED = 14,
    INVALID_MARKET = 15,
    NOT_IMPLEMENTED = 100,
    FEED_DOWN = 22,
    TOO_MANY_ORDER_SUBMITS = 28,
    RESEND_REQUESTED = 29,
    LOCKED_USER = 31,
    EXCEEDS_NOP_LIMIT = 32,
    EXCEEDS_DSL_LIMIT = 33,
    EXCEEDS_POSITION_LIMIT = 34,
    EXCEEDS_PENDING_LIMIT = 35,
    EXCEEDS_SINGLE_LIMIT = 36,
    TRADE_LIMIT_RESTRICTION = 40,
    NOT_APPLICABLE = 254
    };

    static const char* Name;

    static void initializeEnum();
    static void finalizeEnum();

    static bool isValid( unsigned char iv );

    // Convert from an emum to various other things.
    static unsigned char toValue( Type iv );
    static const char* toString( unsigned char iv );
    static unsigned char toIndex( Type );

    // Convert from various other things to an enum.
    static Type fromValue( unsigned char iv );
    static Type fromIndex( unsigned char index );
    static Type fromString( const char* );

private:
    static bool _initialized;
    static const unsigned int _maxValue;
    static const unsigned int _nbValues;

    static const char* _names[255];
    static unsigned char _toIndex[255];
    static Type _fromIndex[20];

};

std::ostream& operator<<( std::ostream& os, CancelRejectReason::Type en );

} // MFAPI

#endif
// InclKwds: CancelRejectReason
