XdmfCoreItemFactory.hpp 3.27 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 : XdmfCoreItemFactory.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
31
#ifndef XDMFCOREITEMFACTORY_HPP_
#define XDMFCOREITEMFACTORY_HPP_

// Forward Declarations
class XdmfItem;

// Includes
#include <map>
32
#include <vector>
33
#include <string>
34
35
#include "XdmfCore.hpp"
#include "XdmfSharedPtr.hpp"
36
37

/**
38
 * @brief Factory that constructs XdmfItems using tags and properties.
39
40
41
 *
 * XdmfCoreItemFactory is an abstract base class.
 */
42
class XDMFCORE_EXPORT XdmfCoreItemFactory {
43

44
public:
45

46
  virtual ~XdmfCoreItemFactory() = 0;
47

48
49
50
  /**
   * Create a new XdmfItem.
   *
51
52
   * Example of use:
   *
53
   * @dontinclude ExampleXdmfCoreItemFactory.cpp
54
55
   * @skipline //#createItem
   * @until //#createItem
56
57
58
   *
   * Python
   *
59
   * @dontinclude XdmfExampleCoreItemFactory.py
60
61
   * @skipline #//createItem
   * @until #//createItem
62
   *
63
64
65
   * @param     itemTag         A string containing the tag of the XdmfItem to create.
   * @param     itemProperties  A map of key/value properties for the the XdmfItem.
   * @param     childItems      The children of the XdmfItem to create.
66
   *
67
68
   * @return                    Constructed XdmfItem. If no XdmfItem can be constructed,
   *                            return NULL.
69
   */
70
  virtual shared_ptr<XdmfItem>
71
72
  createItem(const std::string & itemTag,
             const std::map<std::string, std::string> & itemProperties,
73
             const std::vector<shared_ptr<XdmfItem> > & childItems) const;
74

75
protected:
76

77
  XdmfCoreItemFactory();
78

79
private:
80

81
82
  XdmfCoreItemFactory(const XdmfCoreItemFactory &);  // Not implemented.
  void operator=(const XdmfCoreItemFactory &);  // Not implemented.
83
84
85
86

};

#endif /* XDMFCOREITEMFACTORY_HPP_ */