/*
 *  TnMapResourceData.h
 *  OpenGL Map Engine
 *
 *  Created by Thant on 03/25/2013
 *  Copyright 2013 TeleNav Inc. All rights reserved.
 *
 */

#ifndef TN_MAP_RESOURCE_H
#define TN_MAP_RESOURCE_H

#include <assert.h>
#include <foundation/SharedArray.h>

typedef Tn::Foundation::shared_array<uint8_t> TnMapBytes;

struct TnMapResource
{
    TnMapResource() : size(0) {}
    TnMapResource(TnMapBytes const & bytes,
                  uint32_t size) :
        bytes(bytes),
        begin(0),
        end(size),
        size(size) {}

    TnMapResource(TnMapResource const & resource, uint32_t begin, uint32_t end) :
        bytes(resource.bytes),
        begin(begin),
        end(end),
        size(resource.size) {
        assert((end<=size) && (begin<size));
    }

    TnMapBytes bytes;
    uint32_t begin;
    uint32_t end;
    uint32_t size;
};

#endif
