XdmfItemFactory.hpp 3 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfItemFactory.hpp                                                 */
/*                                                                           */
/*  Author:                                                                  */
/*     Kenneth Leiter                                                        */
/*     kenneth.leiter@arl.army.mil                                           */
/*     US Army Research Laboratory                                           */
/*     Aberdeen Proving Ground, MD                                           */
/*                                                                           */
/*     Copyright @ 2011 US Army Research Laboratory                          */
/*     All Rights Reserved                                                   */
/*     See Copyright.txt for details                                         */
/*                                                                           */
/*     This software is distributed WITHOUT ANY WARRANTY; without            */
/*     even the implied warranty of MERCHANTABILITY or FITNESS               */
/*     FOR A PARTICULAR PURPOSE.  See the above copyright notice             */
/*     for more information.                                                 */
/*                                                                           */
/*****************************************************************************/

24 25 26 27 28 29 30
#ifndef XDMFITEMFACTORY_HPP_
#define XDMFITEMFACTORY_HPP_

// Forward Declarations
class XdmfItem;

// Includes
31
#include "Xdmf.hpp"
32 33 34
#include "XdmfCoreItemFactory.hpp"

/**
35 36
 * @brief Factory for constructing XdmfItems from their ItemTag and
 * ItemProperties.
37
 */
38
class XDMF_EXPORT XdmfItemFactory : public XdmfCoreItemFactory {
39

40
public:
41

42 43 44
  /**
   * Create a new XdmfItemFactory.
   *
45 46 47 48
   * Example of use:
   *
   * C++
   *
49
   * @dontinclude ExampleXdmfItemFactory.cpp
50 51
   * @skipline //#initialization
   * @until //#initialization
52 53 54
   *
   * Python
   *
55
   * @dontinclude XdmfExampleItemFactory.py
56 57
   * @skipline #//initialization
   * @until #//initialization
58
   *
59 60
   * @return constructed XdmfItemFactory.
   */
61
  static shared_ptr<XdmfItemFactory> New();
62

63
  virtual ~XdmfItemFactory();
64

65
  virtual shared_ptr<XdmfItem>
66 67
  createItem(const std::string & itemTag,
             const std::map<std::string, std::string> & itemProperties,
68
             const std::vector<shared_ptr<XdmfItem> > & childItems) const;
69

70
protected:
71

72
  XdmfItemFactory();
73

74
private:
75

76 77
  XdmfItemFactory(const XdmfItemFactory &);  // Not implemented.
  void operator=(const XdmfItemFactory &);  // Not implemented.
78 79 80

};

81
#ifdef _WIN32
82
XDMF_TEMPLATE template class XDMF_EXPORT shared_ptr<XdmfItemFactory>;
83 84
#endif

85
#endif /* XDMFITEMFACTORY_HPP_ */