00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef PHX_DATA_CONTAINER_HPP
00033 #define PHX_DATA_CONTAINER_HPP
00034
00035 #include <iostream>
00036 #include <sstream>
00037 #include <map>
00038 #include <vector>
00039 #include <algorithm>
00040 #include "Teuchos_RCP.hpp"
00041 #include "Teuchos_ArrayRCP.hpp"
00042 #include "Phalanx_FieldTag.hpp"
00043 #include "Phalanx_FieldTag_STL_Functors.hpp"
00044 #include "Phalanx_DataContainer_Base.hpp"
00045
00046 namespace PHX {
00047
00054 template <typename DataT, typename Traits>
00055 class DataContainer : public PHX::DataContainerBase<Traits> {
00056
00057 public:
00058
00059 DataContainer() {}
00060
00061 ~DataContainer() {}
00062
00063 Teuchos::ArrayRCP<DataT> getFieldData(const PHX::FieldTag& t);
00064
00065 void allocateField(const Teuchos::RCP<PHX::FieldTag>& t,
00066 std::size_t max_num_cells,
00067 typename Traits::Allocator& a);
00068
00069 const std::type_info& dataTypeInfo() const;
00070
00071 std::size_t getSizeOfDataType() const;
00072
00073 void print(std::ostream& os) const;
00074
00075 private:
00076
00077 std::map< Teuchos::RCP<const PHX::FieldTag>,
00078 Teuchos::ArrayRCP<DataT>,
00079 FTComp >
00080 m_data;
00081
00082 };
00083
00084 template <typename DataT, typename Traits>
00085 std::ostream& operator<<(std::ostream& os,
00086 const PHX::DataContainer<DataT, Traits>& dc)
00087 {
00088 dc.print(os);
00089 return os;
00090 }
00091
00092 }
00093
00094 #include "Phalanx_DataContainer_Def.hpp"
00095
00096 #endif