add Vector class

This commit is contained in:
Hieu Hoang 2015-12-07 20:27:53 +00:00
parent 4237df8f0a
commit cda08ecc19
3 changed files with 39 additions and 0 deletions

View File

@ -22,6 +22,7 @@ external-lib boost_serialization ;
TargetPhrase.cpp
TargetPhrases.cpp
TranslationTask.cpp
Vector.cpp
Weights.cpp
Word.cpp
FF/Distortion.cpp

View File

@ -0,0 +1,9 @@
/*
* Vector.cpp
*
* Created on: 7 Dec 2015
* Author: hieu
*/
#include "Vector.h"

View File

@ -0,0 +1,29 @@
/*
* Vector.h
*
* Created on: 7 Dec 2015
* Author: hieu
*/
#pragma once
#include "MemPool.h"
template <typename T>
class Vector {
public:
Vector(MemPool &pool, size_t size)
:m_size(size)
{
m_arr = pool.Allocate<T>(size);
}
virtual ~Vector()
{
}
protected:
size_t m_size;
T *m_arr;
};