/*

:copyright: Copyright 2006-2024 by the PyNN team, see AUTHORS.
:license: CeCILL, see LICENSE for details.

*/

// include headers with your own stuff
#include "simple_stochastic_synapse.h"
#include "stochastic_stp_synapse.h"
#include "stochastic_stp_synapse_impl.h"

#include "nest_extension_interface.h"

// -- Interface to dynamic module loader ---------------------------------------

/*
 * There are three scenarios, in which PyNNExtensions can be loaded by NEST:
 *
 * 1) When loading your module with `Install`, the dynamic module loader must
 * be able to find your module. You make the module known to the loader by
 * defining an instance of your module class in global scope. (LTX_MODULE is
 * defined) This instance must have the name
 *
 * <modulename>_LTX_mod
 *
 * The dynamicloader can then load modulename and search for symbol "mod" in it.
 *
 * 2) When you link the library dynamically with NEST during compilation, a new
 * object has to be created. In the constructor the DynamicLoaderModule will
 * register your module. (LINKED_MODULE is defined)
 *
 * 3) When you link the library statically with NEST during compilation, the
 * registration will take place in the file `static_modules.h`, which is
 * generated by cmake.
 */

namespace pynn
{
  class PyNNExtensions : public nest::NESTExtensionInterface
  {
  public:
      PyNNExtensions() {}
      ~PyNNExtensions() {}

      void initialize() override;
  };
}

pynn::PyNNExtensions pynn_extensions_LTX_module;

//-------------------------------------------------------------------------------------

void
pynn::PyNNExtensions::initialize()
{
  /* Register a neuron or device model.
     Give node type as template argument and the name as second argument.
  */
  /* nest::kernel().model_manager.register_node_model< pif_psc_alpha >(
    "pif_psc_alpha" );
  */

  /* Register a synapse type.
     Give synapse type as template argument and the name as second argument.

     There are two choices for the template argument:
         - nest::TargetIdentifierPtrRport
         - nest::TargetIdentifierIndex
     The first is the standard and you should usually stick to it.
     nest::TargetIdentifierIndex reduces the memory requirement of synapses
     even further, but limits the number of available rports. Please see
     Kunkel et al, Front Neurofinfom 8:78 (2014), Sec 3.3.2, for details.
  */
  nest::register_connection_model< simple_stochastic_synapse >( "simple_stochastic_synapse" );
  nest::register_connection_model< stochastic_stp_synapse >( "stochastic_stp_synapse" );

} // PyNNExtensions::init()
