How to use the tstl/container/TreeMap.TreeMap function in tstl

To help you get started, we’ve selected a few tstl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github samchon / tgrid / src / protocols / web / WebError.ts View on Github external
/**
         * @inheritDoc
         */
        public message(val: number): string
        {
            let it = DESCRIPTIONS.upper_bound(val).prev();
            return it.second;
        }
    }
}

/**
 * @hidden
 */
const DESCRIPTIONS = new TreeMap
([
    // HTTP PROTOCOL
    {first: 0, second: "Reserved and not used."},

    // WEB-SOCKET PROTOCOL
    {first: 1000, second: "Normal closure; the connection successfully completed whatever purpose for which it was created."},
    {first: 1001, second: "The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connectio"},
    {first: 1002, second: "The endpoint is terminating the connection due to a protocol error."},
    {first: 1003, second: "The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},
    {first: 1004, second: "Reserved. A meaning might be defined in the future."},
    {first: 1005, second: "Indicates that no status code was provided even though one was expected."},
    {first: 1006, second: "Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},
    {first: 1007, second: "The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},
    {first: 1008, second: "The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},
    {first: 1009, second: "The endpoint is terminating the connection because a data frame was received that is too large."},
    {first: 1010, second: "The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},