XdmfDataItem.cpp 1006 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
/*
 * XdmfDataItem.cpp
 *
 *  Created on: Jan 29, 2010
 *      Author: kleiter
 */

#include "XdmfDataItem.hpp"
#include "XdmfVisitor.hpp"

XdmfDataItem::XdmfDataItem() :
12 13
	mDataType(XdmfDataItemType::Unknown()),
	mNumberValues(0)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
{
	std::cout << "Created DataItem " << this << std::endl;
}

XdmfDataItem::~XdmfDataItem()
{
	std::cout << "Deleted DataItem " << this << std::endl;
}

std::string XdmfDataItem::printSelf() const
{
	return "XdmfDataItem";
}

template <>
void XdmfDataItem::setData<int>(int* dataPointer)
{
	mDataPointer = dataPointer;
	mDataType = XdmfDataItemType::Int32();
}

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
template <>
int* XdmfDataItem::getData<int>()
{
	return mDataPointer;
}

template <>
const int* const XdmfDataItem::getData<int>() const
{
	return mDataPointer;
}

int XdmfDataItem::getNumberValues() const
{
	return mNumberValues;
}

void XdmfDataItem::setNumberValues(int numValues)
{
	mNumberValues = numValues;
}

57 58 59 60
void XdmfDataItem::write(boost::shared_ptr<XdmfVisitor> visitor) const
{
	visitor->visit(this);
}