NEST  2.6.0,not_revisioned_source_dir@0
conn_builder_factory.h
Go to the documentation of this file.
1 /*
2  * conn_builder_factory.h
3  *
4  * This file is part of NEST.
5  *
6  * Copyright (C) 2004 The NEST Initiative
7  *
8  * NEST is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * NEST is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef CONN_BUILDER_FACTORY_H
24 #define CONN_BUILDER_FACTORY_H
25 
26 #include <map>
27 #include "name.h"
28 #include "dictdatum.h"
29 #include "lockptrdatum.h"
30 #include "conn_builder.h"
31 
32 namespace nest {
33 
34  class Network;
35 
44  public:
46  virtual ConnBuilder* create(Network&,
47  const GIDCollection&,
48  const GIDCollection&,
49  const DictionaryDatum&,
50  const DictionaryDatum&) const =0;
51  };
52 
57  template <typename ConnBuilderType>
59 
60  public:
61 
64  const GIDCollection& sources,
65  const GIDCollection& targets,
66  const DictionaryDatum& conn_spec,
67  const DictionaryDatum& syn_spec) const
68  {
69  return new ConnBuilderType(net, sources, targets, conn_spec, syn_spec);
70  }
71  };
72 
73 } // namespace nest
74 
75 #endif
Definition: lockptrdatum.h:40
ConnBuilder * create(Network &net, const GIDCollection &sources, const GIDCollection &targets, const DictionaryDatum &conn_spec, const DictionaryDatum &syn_spec) const
create conn builder
Definition: conn_builder_factory.h:63
Generic factory class for ConnBuilder objects.
Definition: conn_builder_factory.h:43
virtual ~GenericConnBuilderFactory()
Definition: conn_builder_factory.h:45
Definition: gid_collection.h:37
const Name sources("sources")
Definition: topology_names.h:56
Main administrative interface to the network.
Definition: network.h:135
Factory class for generating objects of type ConnBuilder.
Definition: conn_builder_factory.h:58
const Name targets("targets")
Connection parameters.
Definition: nest_names.h:284
virtual ConnBuilder * create(Network &, const GIDCollection &, const GIDCollection &, const DictionaryDatum &, const DictionaryDatum &) const =0
Abstract base class for ConnBuilders.
Definition: conn_builder.h:60