NEST main@caf0ae8
 
Loading...
Searching...
No Matches
connection_manager_impl.h
Go to the documentation of this file.
1/*
2 * connection_manager_impl.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 CONNECTION_MANAGER_IMPL_H
24#define CONNECTION_MANAGER_IMPL_H
25
26#include "connection_manager.h"
27
28// C++ includes:
29#include <string>
30
31// Includes from nestkernel:
32#include "conn_builder.h"
34#include "connector_base.h"
35#include "kernel_manager.h"
37
38namespace nest
39{
40
41template < typename ConnBuilder >
42void
44{
45 assert( not connruledict_.known( name ) );
47 assert( cb );
48
49 const size_t idx = connbuilder_factories_.size();
50 connbuilder_factories_.push_back( cb );
51 connruledict_[ name ] = static_cast< long >( idx );
52}
53
54template < typename ThirdConnBuilder >
55void
57{
58 assert( not thirdconnruledict_.known( name ) );
60 assert( cb );
61 const size_t idx = thirdconnbuilder_factories_.size();
62 thirdconnbuilder_factories_.push_back( cb );
63 thirdconnruledict_[ name ] = static_cast< long >( idx );
64}
65
66inline void
67ConnectionManager::send_to_devices( const size_t tid, const size_t source_node_id, Event& e )
68{
69 target_table_devices_.send_to_device( tid, source_node_id, e, kernel().model_manager.get_connection_models( tid ) );
70}
71
72inline void
73ConnectionManager::send_to_devices( const size_t tid, const size_t source_node_id, SecondaryEvent& e )
74{
75 target_table_devices_.send_to_device( tid, source_node_id, e, kernel().model_manager.get_connection_models( tid ) );
76}
77
78inline void
79ConnectionManager::send_from_device( const size_t tid, const size_t ldid, Event& e )
80{
81 target_table_devices_.send_from_device( tid, ldid, e, kernel().model_manager.get_connection_models( tid ) );
82}
83
84} // namespace nest
85
86#endif /* CONNECTION_MANAGER_IMPL_H */
bool known(const std::string &key) const
Check whether there exists a value with specified key in the dictionary.
Definition dictionary.h:677
Factory class for bipartite ConnBuilders.
Definition conn_builder_factory.h:70
void register_conn_builder(const std::string &name)
Add a connectivity rule, i.e.
Definition connection_manager_impl.h:43
void send_from_device(const size_t tid, const size_t ldid, Event &e)
Send event e to all targets of source device ldid (local device id)
Definition connection_manager_impl.h:79
void send_to_devices(const size_t tid, const size_t source_node_id, Event &e)
Send event e to all device targets of source source_node_id.
Definition connection_manager_impl.h:67
std::vector< GenericThirdConnBuilderFactory * > thirdconnbuilder_factories_
Third-factor ConnBuilder factories, indexed by thirdconnruledict_ elements.
Definition connection_manager.h:674
Dictionary thirdconnruledict_
Dictionary for third-factor connection rules.
Definition connection_manager.h:671
TargetTableDevices target_table_devices_
Definition connection_manager.h:656
Dictionary connruledict_
Dictionary for connection rules.
Definition connection_manager.h:666
std::vector< GenericBipartiteConnBuilderFactory * > connbuilder_factories_
ConnBuilder factories, indexed by connruledict_ elements.
Definition connection_manager.h:669
void register_third_conn_builder(const std::string &name)
Add a connectivity rule, i.e.
Definition connection_manager_impl.h:56
Encapsulate information sent between nodes.
Definition event.h:103
Generic factory class for bipartite ConnBuilder objects.
Definition conn_builder_factory.h:44
Generic factory class for tripartite ConnBuilder objects.
Definition conn_builder_factory.h:91
Base class of secondary events.
Definition secondary_event.h:50
void send_to_device(const size_t tid, const size_t s_node_id, Event &e, const std::vector< ConnectorModel * > &cm)
Sends a spike event to all targets of the source neuron.
Definition target_table_devices_impl.h:79
void send_from_device(const size_t tid, const size_t ldid, Event &e, const std::vector< ConnectorModel * > &cm)
Sends a spike event to all targets of the source device.
Definition target_table_devices.h:230
Factory class for Third-factor ConnBuilders.
Definition conn_builder_factory.h:112
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
KernelManager & kernel()
Definition kernel_manager.h:311