CPN
Computational Process Networks
NodeFactory.h
Go to the documentation of this file.
1 //=============================================================================
2 // Computational Process Networks class library
3 // Copyright (C) 1997-2006 Gregory E. Allen and The University of Texas
4 //
5 // This library is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU Library General Public License as published
7 // by the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
14 //
15 // The GNU Public License is available in the file LICENSE, or you
16 // can write to the Free Software Foundation, Inc., 59 Temple Place -
17 // Suite 330, Boston, MA 02111-1307, USA, or you can find it on the
18 // World Wide Web at http://www.fsf.org.
19 //=============================================================================
24 #ifndef CPN_NODEFACTORY_H
25 #define CPN_NODEFACTORY_H
26 #pragma once
27 
28 #include <cpn/common.h>
29 #include <string>
30 
31 namespace CPN {
32 
38  public:
39  NodeFactory(const std::string &name_);
40 
41  virtual ~NodeFactory();
52  virtual shared_ptr<NodeBase> Create(Kernel &ker, const NodeAttr &attr) = 0;
53 
58  const std::string &GetName(void) const { return name; }
59 
60  private:
61  const std::string name;
62  };
63 
64 }
65 
66 #endif
67 
Attributes for a node.
Definition: NodeAttr.h:58
const std::string & GetName(void) const
Definition: NodeFactory.h:58
#define CPN_API
Definition: common.h:36
const std::string name
Definition: NodeFactory.h:61
The node factory provides a method for the kernel to create arbitrary user defined Nodes...
Definition: NodeFactory.h:37
The Kernel declaration.
Definition: Kernel.h:55