| 804 | } |
| 805 | |
| 806 | void |
| 807 | XdmfArray::initialize(const shared_ptr<const XdmfArrayType> & arrayType, |
| 808 | const unsigned int size) |
| 809 | { |
| 810 | if(arrayType == XdmfArrayType::Int8()) { |
| 811 | this->initialize<char>(size); |
| 812 | } |
| 813 | else if(arrayType == XdmfArrayType::Int16()) { |
| 814 | this->initialize<short>(size); |
| 815 | } |
| 816 | else if(arrayType == XdmfArrayType::Int32()) { |
| 817 | this->initialize<int>(size); |
| 818 | } |
| 819 | else if(arrayType == XdmfArrayType::Int64()) { |
| 820 | this->initialize<int64_t>(size); |
| 821 | } |
| 822 | else if(arrayType == XdmfArrayType::Float32()) { |
| 823 | this->initialize<float>(size); |
| 824 | } |
| 825 | else if(arrayType == XdmfArrayType::Float64()) { |
| 826 | this->initialize<double>(size); |
| 827 | } |
| 828 | else if(arrayType == XdmfArrayType::UInt8()) { |
| 829 | this->initialize<unsigned char>(size); |
| 830 | } |
| 831 | else if(arrayType == XdmfArrayType::UInt16()) { |
| 832 | this->initialize<unsigned short>(size); |
| 833 | } |
| 834 | else if(arrayType == XdmfArrayType::UInt32()) { |
| 835 | this->initialize<unsigned int>(size); |
| 836 | } |
| 837 | else if(arrayType == XdmfArrayType::UInt64()) { |
| 838 | this->initialize<uint64_t>(size); |
| 839 | } |
| 840 | else if(arrayType == XdmfArrayType::String()) { |
| 841 | this->initialize<std::string>(size); |
| 842 | } |
| 843 | else if(arrayType == XdmfArrayType::Uninitialized()) { |
| 844 | this->release(); |
| 845 | } |
| 846 | else { |
| 847 | XdmfError::message(XdmfError::FATAL, |
| 848 | "Array of unsupported type in XdmfArray::initialize"); |
| 849 | } |
| 850 | this->setIsChanged(true); |
| 851 | } |
| 852 | |
| 853 | void |
| 854 | XdmfArray::initialize(const shared_ptr<const XdmfArrayType> & arrayType, |
no test coverage detected