NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
nest::GenericModel< ElementT > Class Template Reference

Generic Model template. More...

#include <genericmodel.h>

Inheritance diagram for nest::GenericModel< ElementT >:
nest::Model

Public Member Functions

 GenericModel (const std::string &)
 
 GenericModel (const char[])
 
 GenericModel (const GenericModel &, const std::string &)
 Create copy of model with new name. More...
 
Modelclone (const std::string &) const
 Return pointer to cloned model with same name. More...
 
bool has_proxies ()
 
bool potential_global_receiver ()
 
bool one_node_per_process ()
 
bool is_off_grid ()
 
port send_test_event (Node &, rport, synindex, bool)
 
Node const & get_prototype () const
 Return const reference to the prototype. More...
 
void set_model_id (int)
 Set the model id on the prototype. More...
 
- 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. More...
 
Nodeallocate (thread t)
 Allocate new Node and return its pointer. More...
 
void free (thread t, Node *)
 
void clear ()
 Deletes all nodes which belong to this model. More...
 
void reserve_additional (thread t, size_t n)
 Reserve memory for at least n additional Nodes. More...
 
std::string get_name () const
 Return name of the Model. More...
 
size_t mem_available ()
 Return the available memory. More...
 
size_t mem_capacity ()
 Return the memory capacity. More...
 
void set_status (DictionaryDatum)
 Change properties of the prototype node according to the entries in the dictionary. More...
 
DictionaryDatum get_status (void)
 Export properties of the prototype node by setting entries in the status dictionary. More...
 
void set_type_id (index id)
 Set the model id on the prototype. More...
 
index get_type_id () const
 

Private Member Functions

void set_status_ (DictionaryDatum)
 
DictionaryDatum get_status_ ()
 
size_t get_element_size () const
 Return the size of the prototype. More...
 
Nodeallocate_ (void *)
 Call placement new on the supplied memory position. More...
 
void init_memory_ (sli::pool &)
 Initialize the pool allocator with the node specific properties. More...
 

Private Attributes

ElementT proto_
 Prototype node from which all instances are constructed. More...
 

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

template<typename ElementT >
nest::GenericModel< ElementT >::GenericModel ( const std::string &  name)
template<typename ElementT >
nest::GenericModel< ElementT >::GenericModel ( const char  name[])
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().

Member Function Documentation

template<typename ElementT >
Node * nest::GenericModel< ElementT >::allocate_ ( void *  adr)
privatevirtual

Call placement new on the supplied memory position.

Implements nest::Model.

References nest::names::n.

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

Return pointer to cloned model with same name.

Implements nest::Model.

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

Return the size of the prototype.

Implements nest::Model.

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

Return const reference to the prototype.

Implements nest::Model.

template<typename ElementT >
DictionaryDatum nest::GenericModel< ElementT >::get_status_ ( )
privatevirtual

Implements nest::Model.

References nest::names::d.

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

Implements nest::Model.

template<typename ElementT >
void nest::GenericModel< ElementT >::init_memory_ ( sli::pool mem)
privatevirtual

Initialize the pool allocator with the node specific properties.

Implements nest::Model.

References sli::pool::init().

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

Implements nest::Model.

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

Implements nest::Model.

template<typename ElementT >
bool nest::GenericModel< ElementT >::potential_global_receiver ( )
inlinevirtual

Implements nest::Model.

template<typename ElementT >
port nest::GenericModel< ElementT >::send_test_event ( Node target,
rport  receptor,
synindex  syn_id,
bool  dummy_target 
)
inlinevirtual
Note
The decision of whether one node can receive a certain event was originally in the node. But in the distributed case, it may be that you only have a proxy node and not he real thing. Thus, you need to be able to make this decision without having the node. Since the model now takes responsibility for a lot of general node properties, it was a natural place to put this function.

Model::send_test_event() is a forwarding function that calls 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.

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

Set the model id on the prototype.

Implements nest::Model.

template<typename ElementT >
void nest::GenericModel< ElementT >::set_status_ ( DictionaryDatum  d)
privatevirtual

Implements nest::Model.

Member Data Documentation

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 file: