10 #include <string_view>
45 struct model_sorted_token;
62 using ::std::runtime_error::runtime_error;
75 template <
typename Callable,
typename... Args>
78 return std::invoke(std::forward<Args>(args)...);
82 }
catch (std::exception
const& e) {
83 std::string message{message_prefix()};
84 std::string_view what{e.what()};
103 extern "C" double hoc_pow(
double,
double);
109 int nrn_mlh_gsort(
double* vec,
int* base_ptr,
int total_elems,
int (*cmp)(
double,
double));
126 [[deprecated(
"non-void* overloads are preferred")]]
int vector_capacity(
void*);
128 [[deprecated(
"non-void* overloads are preferred")]]
void vector_resize(
void*,
int);
129 [[deprecated(
"non-void* overloads are preferred")]]
double*
vector_vec(
void*);
155 double chkarg(
int,
double low,
double high);
168 void hoc_plt(
int,
double,
double);
173 template <
typename T>
201 template <
typename T>
216 template <
typename T>
226 template <
typename T>
230 hoc_get_arg<neuron::container::generic_data_handle>(
narg)};
243 template <
typename T>
254 return static_cast<double*
>(hoc_get_arg<neuron::container::data_handle<double>>(
narg));
264 using TmpObject = std::unique_ptr<Object, TmpObjectDeleter>;
272 template <
typename T>
274 return hoc_pop<neuron::container::data_handle<T>>();
283 template <
typename T>
285 return hoc_get_arg<neuron::container::data_handle<T>>(
narg);
300 template <
typename T>
390 [[nodiscard]]
int hoc_oc(
const char*);
391 [[nodiscard]]
int hoc_oc(
const char*, std::ostream& os);
396 double hoc_opasgn(
int op,
double dest,
double src);
421 int hoc_ired(
const char*,
int,
int,
int);
422 double hoc_xred(
const char*,
double,
double,
double);
423 int hoc_sred(
const char*,
char*,
char*);
431 int hoc_main1(
int,
const char**,
const char**);
char * hoc_object_pathname(Object *)
int hoc_xopen1(const char *, const char *)
int vector_capacity(IvocVect *)
int hoc_is_object_arg(int)
void hoc_push_frame(Symbol *, int)
Object * hoc_name2obj(const char *name, int index)
void hoc_plprint(const char *)
void hoc_obj_set(int i, Object *)
void hoc_prstack()
Print up to the 10 most-recently-pushed elements on the stack.
void hoc_audit_command(const char *)
void hoc_reg_nmodl_filename(int type, const char *filename)
void hoc_run_stmt(Symbol *)
void hoc_construct_point(Object *, int)
int hoc_ired(const char *, int, int, int)
void hoc_xopen_from_audit(const char *fname)
void hoc_unlink_symbol(Symbol *, Symlist *)
int hoc_retrieving_audit()
int hoc_obj_run(const char *, Object *)
Brief explanation of hoc_obj_run.
void sym_extra_alloc(Symbol *)
void * nrn_opaque_obj2pyobj(Object *)
Object ** hoc_objgetarg(int)
void hoc_pushstr(char **)
void hoc_execerr_ext(const char *fmt,...)
printf style specification of hoc_execerror message.
HocSymExtension * hoc_var_extra(const char *)
double hoc_func_table(void *vpft, int n, double *args)
double chkarg(int, double low, double high)
void hoc_reg_nmodl_text(int type, const char *txt)
void hoc_execerror(const char *, const char *)
Object * ivoc_list_item(Object *, int)
Object * nrn_nmodlrandom_wrap(Prop *prop, Symbol *sym)
double hoc_call_func(Symbol *, int narg)
Symbol * hoc_get_symbol(const char *var)
int ivoc_list_look(Object *, Object *, char *, int)
void hoc_new_object_asgn(Object **obp, Symbol *template_symbol, void *cpp_object)
size_t hoc_total_array_data(const Symbol *, Objectdata *)
neuron::container::data_handle< double > hoc_val_handle(std::string_view)
Object * hoc_obj_look_inside_stack(int)
char * cxx_char_alloc(std::size_t size)
int hoc_arayinfo_install(Symbol *, int)
Object ** hoc_temp_objvar(Symbol *template_symbol, void *cpp_object)
void vector_resize(IvocVect *, int)
int vector_instance_px(void *, double **)
IvocVect * vector_new2(IvocVect *)
void hoc_template_notify(Object *, int)
void hoc_pushpx(double *)
neuron::container::data_handle< T > hoc_pop_handle()
Shorthand for hoc_pop<data_handle<T>>().
IvocVect * vector_new(int, Object *=nullptr)
std::unique_ptr< Object, TmpObjectDeleter > TmpObject
int hoc_inside_stacktype(int)
int vector_arg_px(int i, double **p)
void hoc_pushobj(Object **)
Object ** hoc_objpop()
Pop pointer to object pointer and return top elem from stack.
int ivoc_list_count(Object *)
void hoc_free_string(char *)
void hoc_call_ob_proc(Object *ob, Symbol *sym, int narg)
void hoc_spec_table(void **pfunctable, int n)
Object * hoc_obj_get(int i)
double hoc_xred(const char *, double, double, double)
void hoc_freearay(Symbol *)
double check_domain_limits(float *, double)
T hoc_get_arg(std::size_t narg)
Get the nth (1..N) argument on the stack.
void * hoc_sec_internal_name2ptr(const char *s, int eflag)
void hoc_plt(int, double, double)
void * nrn_parsing_pysec_
int hoc_stack_type()
Get the type of the top entry.
void vector_set_label(IvocVect *, char *)
Symbol * hoc_install(const char *, int, double, Symlist **)
std::FILE * hoc_obj_file_arg(int i)
double * vector_vec(IvocVect *)
void hoc_free_object(Object *)
void hoc_audit_from_xopen1(const char *, const char *)
int hoc_retrieve_audit(int id)
int hoc_is_temp_charptr(char **cpp)
void hoc_free_pstring(char **)
void notify_pointer_freed(void *)
bool hoc_stack_type_is_ndim()
Symbol * hoc_table_lookup(const char *, Symlist *)
void hoc_oop_initaftererror()
Object * nrn_pntproc_nmodlrandom_wrap(void *pnt, Symbol *sym)
Objectdata * hoc_objectdata
T hoc_pop()
Pop an object of type T from the HOC stack.
void hoc_assign_str(char **pstr, const char *buf)
void hoc_audit_from_final_exit()
const char * expand_env_var(const char *)
double * hoc_val_pointer(const char *)
Object ** hoc_temp_objptr(Object *)
void hoc_register_var(DoubScal *, DoubVec *, VoidFunc *)
double hoc_opasgn(int op, double dest, double src)
double hoc_call_objfunc(Symbol *, int narg, Object *)
Object * hoc_new_object(Symbol *symtemp, void *v)
void hoc_tobj_unref(Object **)
void install_vector_method(const char *, double(*)(void *))
Symbol * hoc_parse_expr(const char *, Symlist **)
int is_obj_type(Object *, const char *)
int hoc_sred(const char *, char *, char *)
double hoc_run_expr(Symbol *)
void hoc_warning(const char *, const char *)
char * hoc_symbol_units(Symbol *sym, const char *units)
int hoc_is_double_arg(int)
void hoc_free_list(Symlist **)
std::size_t nrn_mallinfo(int item)
void check_obj_type(Object *, const char *)
void vector_append(IvocVect *, double)
char ** hoc_temp_charptr()
void hoc_obj_disconnect(Object *)
void ivoc_help(const char *)
int hoc_xopen_run(Symbol *, const char *)
void hoc_retpushx(double)
int hoc_chdir(const char *path)
Symbol * hoc_install_var(const char *, double *)
void hoc_obj_notify(Object *)
IvocVect * vector_arg(int)
void hoc_obj_ref(Object *)
char * hoc_object_name(Object *)
double hoc_pow(double, double)
void * hoc_pysec_name2ptr(const char *s, int eflag)
void ivoc_free_alias(Object *)
void hoc_symbol_limits(Symbol *, float, float)
void hoc_dec_refcount(Object **)
int hoc_main1(int, const char **, const char **)
void hoc_free_val_array(double *, std::size_t)
void hoc_install_object_data_index(Symbol *)
Object ** vector_temp_objvar(IvocVect *)
neuron::container::data_handle< T > hoc_hgetarg(int narg)
Shorthand for hoc_get_arg<data_handle<T>>(narg).
void hoc_class_registration()
void hoc_fake_call(Symbol *)
void hoc_on_init_register(void(*)())
void hoc_stkobj_unref(Object *, int stkindex)
void hoc_audit_from_hoc_main1(int, const char **, const char **)
Object ** vector_pobj(IvocVect *)
double * hoc_pgetarg(int narg)
int vector_buffer_size(IvocVect *)
int hoc_araypt(Symbol *, int)
void hoc_execerror_mes(const char *, const char *, int)
std::size_t hoc_total_array(Symbol *)
double hoc_scan(std::FILE *)
void hoc_sprint1(char **, int)
Symbol * hoc_lookup(const char *)
IvocVect * vector_new1(int)
void state_discontinuity(int i, double *pd, double d)
int hoc_is_pdouble_arg(int)
void hoc_free_arrayinfo(Arrayinfo *)
T const & hoc_look_inside_stack(int i)
Get the stack entry at depth i.
void vector_delete(IvocVect *)
void hoc_obj_unref(Object *)
void hoc_call_func_result_on_stack(Symbol *s, int narg)
Symbol * ivoc_alias_lookup(const char *, Object *)
void hoc_free_allobjects(cTemplate *, Symlist *, Objectdata *)
void notify_freed(void *)
char * vector_get_label(IvocVect *)
int nrn_mlh_gsort(double *vec, int *base_ptr, int total_elems, int(*cmp)(double, double))
Symbol * hoc_parse_stmt(const char *, Symlist **)
char * hoc_araystr(Symbol *, int, Objectdata *)
void hoc_push_object(Object *)
int hoc_is_tempobj_arg(int narg)
void hoc_push(neuron::container::generic_data_handle handle)
void hoc_link_symbol(Symbol *, Symlist *)
TmpObject hoc_pop_object()
int nrn_mpiabort_on_error_
char ** hoc_pgargstr(int)
double var(InputIterator begin, InputIterator end)
handle_interface< non_owning_identifier< storage > > handle
Non-owning handle to a Mechanism instance.
decltype(auto) invoke_method_that_may_throw(Callable message_prefix, Args &&... args)
Execute C++ code that may throw and propagate HOC information.
In mechanism libraries, cannot use auto const token = nrn_ensure_model_data_are_sorted(); because the...
int const size_t const size_t n
void operator()(Object *) const
Stable handle to a generic value.
Non-template stable handle to a generic value.
static neuron::container::data_handle< T > impl(std::size_t narg)
static neuron::container::generic_data_handle impl(std::size_t)
static neuron::container::data_handle< T > impl()
Pop a data_handle<T> from the HOC stack.
static neuron::container::generic_data_handle impl()
Pop a generic data handle from the HOC stack.