XdmfItemFactory.hpp 3.31 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
#ifndef XDMFITEMFACTORY_HPP_
#define XDMFITEMFACTORY_HPP_

27 28 29 30 31 32 33 34 35
// C Compatible Includes
#include "Xdmf.hpp"
#include "XdmfCoreItemFactory.hpp"
#ifdef XDMF_BUILD_DSM
  #include "XdmfDSMItemFactory.hpp"
#endif

#ifdef __cplusplus

36 37 38 39
// Forward Declarations
class XdmfItem;

// Includes
40
#include "Xdmf.hpp"
41 42 43
#include "XdmfCoreItemFactory.hpp"

/**
44 45
 * @brief Factory for constructing XdmfItems from their ItemTag and
 * ItemProperties.
46
 */
47 48 49
#ifdef XDMF_BUILD_DSM
class XDMF_EXPORT XdmfItemFactory : public XdmfDSMItemFactory {
#else
50
class XDMF_EXPORT XdmfItemFactory : public XdmfCoreItemFactory {
51
#endif
52

53
public:
54

55 56 57
  /**
   * Create a new XdmfItemFactory.
   *
58 59 60 61
   * Example of use:
   *
   * C++
   *
62
   * @dontinclude ExampleXdmfItemFactory.cpp
63 64
   * @skipline //#initialization
   * @until //#initialization
65 66 67
   *
   * Python
   *
68
   * @dontinclude XdmfExampleItemFactory.py
69 70
   * @skipline #//initialization
   * @until #//initialization
71
   *
72
   * @return    Constructed XdmfItemFactory.
73
   */
74
  static shared_ptr<XdmfItemFactory> New();
75

76
  virtual ~XdmfItemFactory();
77

78
  virtual shared_ptr<XdmfItem>
79 80
  createItem(const std::string & itemTag,
             const std::map<std::string, std::string> & itemProperties,
81
             const std::vector<shared_ptr<XdmfItem> > & childItems) const;
82

83 84
  virtual bool isArrayTag(char * tag) const;

85 86 87
  virtual XdmfItem *
  DuplicatePointer(shared_ptr<XdmfItem> original) const;

88
protected:
89

90
  XdmfItemFactory();
91

92
private:
93

94 95
  XdmfItemFactory(const XdmfItemFactory &);  // Not implemented.
  void operator=(const XdmfItemFactory &);  // Not implemented.
96 97 98

};

99

100 101
#endif

102
#endif /* XDMFITEMFACTORY_HPP_ */