Sierra Toolkit Version of the Day
PartRepository.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef stk_mesh_PartRepository_hpp
00010 #define stk_mesh_PartRepository_hpp
00011 
00012 #include <stk_mesh/base/Types.hpp>
00013 #include <stk_mesh/base/Part.hpp>
00014 #include <stk_mesh/baseImpl/PartImpl.hpp>
00015 
00016 
00017 namespace stk {
00018 namespace mesh {
00019 
00020 class MetaData;
00021 
00022 namespace impl {
00023 
00024 
00025 class PartRepository {
00026 public:
00027   explicit PartRepository(MetaData * meta);
00028   ~PartRepository();
00029 
00030   Part * universal_part() const;
00031 
00032   const PartVector & get_all_parts() const;
00033 
00034   Part * declare_part( const std::string & arg_name , EntityRank arg_rank );
00035   Part * declare_part( const PartVector & part_intersect );
00036   void declare_subset( Part & superset, Part & subset );
00037   void declare_part_relation( Part & root_part, PartRelation relation, Part & target_part );
00038 
00039   template<class T>
00040   const T * declare_attribute_with_delete( Part & , const T *);
00041   template<class T>
00042   const T * declare_attribute_no_delete( Part & , const T *);
00043 
00044 private:
00045   PartRepository();
00046   PartRepository(const PartRepository & );
00047   PartRepository & operator = ( const PartRepository & );
00048   
00049   Part * declare_part_impl( const std::string & name, EntityRank rank);
00050   void declare_subset_impl( Part & superset, Part & subset );
00051 
00052   MetaData * m_meta_data;
00053   Part * m_universal_part;
00054   PartVector m_all_parts;
00055 };
00056 
00057 template<class T>
00058 inline
00059 const T *
00060 PartRepository::declare_attribute_with_delete( Part & p, const T * a )
00061 {
00062   return p.m_partImpl.declare_attribute_with_delete<T>( a );
00063 }
00064 
00065 template<class T>
00066 inline
00067 const T *
00068 PartRepository::declare_attribute_no_delete( Part & p, const T * a )
00069 {
00070   return p.m_partImpl.declare_attribute_no_delete<T>( a );
00071 }
00072 
00073 
00074 } // namespace impl 
00075 } // namespace mesh
00076 } // namespace stk
00077 
00078 
00079 #endif // stk_mesh_PartRepository_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends