NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::GenericModel< ElementT > Class Template Reference

Generic Model template. More...

#include <genericmodel.h>

Inheritance diagram for nest::GenericModel< ElementT >:
[legend]
Collaboration diagram for nest::GenericModel< ElementT >:
[legend]

Public Member Functions

 GenericModel (const std::string &, const std::string &deprecation_info)
 
 GenericModel (const GenericModel &, const std::string &)
 Create copy of model with new name.
 
Model * clone (const std::string &) const override
 Return pointer to cloned model with same name.
 
bool has_proxies () override
 
bool one_node_per_process () override
 
bool is_off_grid () override
 
void calibrate_time (const TimeConverter &tc) override
 
size_t send_test_event (Node &, size_t, synindex, bool) override
 Send a test event to a target node.
 
void sends_secondary_event (GapJunctionEvent &ge) override
 
SignalType sends_signal () const override
 Check what type of signal this model is sending.
 
void sends_secondary_event (InstantaneousRateConnectionEvent &re) override
 
void sends_secondary_event (DiffusionConnectionEvent &de) override
 
void sends_secondary_event (DelayedRateConnectionEvent &re) override
 
void sends_secondary_event (LearningSignalConnectionEvent &re) override
 
void sends_secondary_event (SICEvent &sic) override
 
Node const & get_prototype () const override
 Return const reference to the prototype.
 
void set_model_id (int) override
 Set the model id on the prototype.
 
int get_model_id () override
 Get the model id from the prototype.
 
void deprecation_warning (const std::string &) override
 Issue deprecation warning on first call if model is deprecated.
 
- Public Member Functions inherited from nest::Model
 Model (const std::string &name)
 
 Model (const Model &m)
 
virtual ~Model ()
 
void set_threads ()
 Set number of threads based on number set in network.
 
Node * create (size_t t)
 Allocate new Node and return its pointer.
 
void clear ()
 Deletes all nodes which belong to this model.
 
void reserve_additional (size_t t, size_t n)
 Reserve space for n additional Nodes.
 
std::string get_name () const
 Return name of the Model.
 
size_t mem_available ()
 Return the available memory.
 
size_t mem_capacity ()
 Return the memory capacity.
 
void set_status (const Dictionary &)
 Change properties of the prototype node according to the entries in the dictionary.
 
Dictionary get_status ()
 Export properties of the prototype node by setting entries in the status dictionary.
 
void set_type_id (size_t id)
 Set the model id on the prototype.
 
size_t get_type_id () const
 

Private Member Functions

void set_status_ (const Dictionary &) override
 
Dictionary get_status_ () override
 
size_t get_element_size () const override
 Return the size of the prototype.
 
Node * create_ () override
 Call placement new on the supplied memory position.
 

Private Attributes

ElementT proto_
 Prototype node from which all instances are constructed.
 
std::string deprecation_info_
 String containing deprecation information; empty if model not deprecated.
 
bool deprecation_warning_issued_
 False until deprecation warning has been issued once.
 

Detailed Description

template<typename ElementT>
class nest::GenericModel< ElementT >

Generic Model template.

The template GenericModel should be used as base class for custom model classes. It already includes the element factory functionality, as well as a pool based memory manager, so that the user can concentrate on the "real" model aspects.

Constructor & Destructor Documentation

◆ GenericModel() [1/2]

template<typename ElementT >
nest::GenericModel< ElementT >::GenericModel ( const std::string &  name,
const std::string &  deprecation_info 
)

References nest::Model::set_threads().

Here is the call graph for this function:

◆ GenericModel() [2/2]

template<typename ElementT >
nest::GenericModel< ElementT >::GenericModel ( const GenericModel< ElementT > &  oldmod,
const std::string &  newname 
)

Create copy of model with new name.

References nest::Model::get_type_id(), nest::Model::set_threads(), and nest::Model::set_type_id().

Here is the call graph for this function:

Member Function Documentation

◆ calibrate_time()

template<typename ElementT >
void nest::GenericModel< ElementT >::calibrate_time ( const TimeConverter &  tc)
inlineoverridevirtual

Implements nest::Model.

◆ clone()

template<typename ElementT >
Model * nest::GenericModel< ElementT >::clone ( const std::string &  newname) const
overridevirtual

Return pointer to cloned model with same name.

Implements nest::Model.

◆ create_()

template<typename ElementT >
Node * nest::GenericModel< ElementT >::create_ ( )
overrideprivatevirtual

Call placement new on the supplied memory position.

Implements nest::Model.

◆ deprecation_warning()

template<typename ElementT >
void nest::GenericModel< ElementT >::deprecation_warning ( const std::string &  )
overridevirtual

Issue deprecation warning on first call if model is deprecated.

Parameters
callingfunction

Implements nest::Model.

References nest::DEPRECATED, and LOG.

◆ get_element_size()

template<typename ElementT >
size_t nest::GenericModel< ElementT >::get_element_size ( ) const
overrideprivatevirtual

Return the size of the prototype.

Implements nest::Model.

◆ get_model_id()

template<typename ElementT >
int nest::GenericModel< ElementT >::get_model_id ( )
overridevirtual

Get the model id from the prototype.

Implements nest::Model.

◆ get_prototype()

template<typename ElementT >
Node const & nest::GenericModel< ElementT >::get_prototype ( ) const
overridevirtual

Return const reference to the prototype.

Implements nest::Model.

◆ get_status_()

template<typename ElementT >
Dictionary nest::GenericModel< ElementT >::get_status_ ( )
overrideprivatevirtual

Implements nest::Model.

References nest::names::elementsize().

Here is the call graph for this function:

◆ has_proxies()

template<typename ElementT >
bool nest::GenericModel< ElementT >::has_proxies ( )
inlineoverridevirtual

Implements nest::Model.

◆ is_off_grid()

template<typename ElementT >
bool nest::GenericModel< ElementT >::is_off_grid ( )
inlineoverridevirtual

Implements nest::Model.

◆ one_node_per_process()

template<typename ElementT >
bool nest::GenericModel< ElementT >::one_node_per_process ( )
inlineoverridevirtual

Implements nest::Model.

◆ send_test_event()

template<typename ElementT >
size_t nest::GenericModel< ElementT >::send_test_event ( Node &  target,
size_t  receptor,
synindex  syn_id,
bool  dummy_target 
)
inlineoverridevirtual

Send a test event to a target node.

This is a forwarding function that calls Node::send_test_event() from the prototype. Since proxies know the model they represent, they can now answer a call to check connection by referring back to the model.

Implements nest::Model.

◆ sends_secondary_event() [1/6]

template<typename ElementT >
void nest::GenericModel< ElementT >::sends_secondary_event ( DelayedRateConnectionEvent &  re)
inlineoverridevirtual

Implements nest::Model.

◆ sends_secondary_event() [2/6]

template<typename ElementT >
void nest::GenericModel< ElementT >::sends_secondary_event ( DiffusionConnectionEvent &  de)
inlineoverridevirtual

Implements nest::Model.

◆ sends_secondary_event() [3/6]

template<typename ElementT >
void nest::GenericModel< ElementT >::sends_secondary_event ( GapJunctionEvent &  ge)
inlineoverridevirtual

Implements nest::Model.

◆ sends_secondary_event() [4/6]

template<typename ElementT >
void nest::GenericModel< ElementT >::sends_secondary_event ( InstantaneousRateConnectionEvent &  re)
inlineoverridevirtual

Implements nest::Model.

◆ sends_secondary_event() [5/6]

template<typename ElementT >
void nest::GenericModel< ElementT >::sends_secondary_event ( LearningSignalConnectionEvent &  re)
inlineoverridevirtual

Implements nest::Model.

◆ sends_secondary_event() [6/6]

template<typename ElementT >
void nest::GenericModel< ElementT >::sends_secondary_event ( SICEvent &  sic)
inlineoverridevirtual

Implements nest::Model.

◆ sends_signal()

template<typename ElementT >
SignalType nest::GenericModel< ElementT >::sends_signal ( ) const
inlineoverridevirtual

Check what type of signal this model is sending.

Required so that proxynode can formward this call to model that in turn delegates the call to the underlying prototype.

Implements nest::Model.

◆ set_model_id()

template<typename ElementT >
void nest::GenericModel< ElementT >::set_model_id ( int  )
overridevirtual

Set the model id on the prototype.

Implements nest::Model.

References nest::Node::set_model_id().

Here is the call graph for this function:

◆ set_status_()

template<typename ElementT >
void nest::GenericModel< ElementT >::set_status_ ( const Dictionary &  d)
overrideprivatevirtual

Implements nest::Model.

Member Data Documentation

◆ deprecation_info_

template<typename ElementT >
std::string nest::GenericModel< ElementT >::deprecation_info_
private

String containing deprecation information; empty if model not deprecated.

◆ deprecation_warning_issued_

template<typename ElementT >
bool nest::GenericModel< ElementT >::deprecation_warning_issued_
private

False until deprecation warning has been issued once.

◆ proto_

template<typename ElementT >
ElementT nest::GenericModel< ElementT >::proto_
private

Prototype node from which all instances are constructed.


The documentation for this class was generated from the following files: