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

#ifndef __MFAPIGEN_STANDARDTENOR__
#define __MFAPIGEN_STANDARDTENOR__

#include <iostream>

namespace MFAPI {

/** (Enum) Standard length of time used in forwards.
 */

struct StandardTenor
{
    enum Type {
    NA = 0,
    TOD = 1,
    TOM = 2,
    ON = 3,
    TN = 4,
    SP = 5,
    SN = 6,
    W1 = 7,
    W2 = 8,
    W3 = 9,
    M1 = 10,
    M2 = 11,
    M3 = 12,
    M4 = 13,
    M5 = 14,
    M6 = 15,
    M7 = 16,
    M8 = 17,
    M9 = 18,
    M10 = 19,
    M11 = 20,
    Y1 = 21,
    M15 = 22,
    M18 = 23,
    M21 = 24,
    Y2 = 25
    };

    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[26];
    static unsigned char _toIndex[26];
    static Type _fromIndex[26];

};

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

} // MFAPI

#endif
// InclKwds: StandardTenor
