#include "../include/Segment.h"

namespace environment {
namespace data {
  
  Segment::Segment (void)
  {
    name     = "";
    base     = 0;
    size     = 0;
    uncached = false;
    data     = NULL;
    type     = TYPE_TARGET_MEMORY;
    index    = 0;
  }

  Segment::Segment (SEGMENT_TABLE_ENTRY * segment)
  {
    name     = segment->getName();
    
    base     = segment->getBase();
    size     = segment->getSize();
    uncached = segment->getUncached();
    data     = new char [size];
    type     = TYPE_TARGET_MEMORY;
    index    = 0;
  }

  Segment::~Segment(void)
  {
    if (size>0)
      delete [] data;
  }

};
};
