cnorxz/src/multi_array.h

39 lines
687 B
C
Raw Normal View History

2017-02-16 11:20:40 +01:00
// -*- C++ -*-
#ifndef __multi_array_h__
#define __multi_array_h__
#include <cstdlib>
#include "base_def.h"
#include "multi_array_operation.h"
namespace MultiArrayTools
{
template <typename T, class Range>
class MultiArray
{
public:
DEFAULT_MEMBERS(MultiArray);
MultiArray(const Range& range); // !!!!
template <class... NameTypes>
MultiArrayOperation<T,Range>& operator()(const NameTypes&... str) const;
T& operator()(const typename Range::indexType& i);
const T& operator()(const typename Range::indexType& i) const;
private:
bool mInit = false;
std::vector<T> mCont;
std::shared_ptr<Range> mRange;
};
}
#include "multi_array.cc"
#endif