Skip to content

Commit

Permalink
Remove all HTList
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Dec 10, 2024
1 parent f1d19d4 commit f7149cc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 218 deletions.
1 change: 0 additions & 1 deletion cmake/NeuronFileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ set(IVOC_FILE_LIST
grglyph.cpp
grmanip.cpp
hocmark.cpp
htlist.cpp
idraw.cpp
ivoc.cpp
ivocmain.cpp
Expand Down
121 changes: 0 additions & 121 deletions src/ivoc/htlist.cpp

This file was deleted.

86 changes: 0 additions & 86 deletions src/ivoc/htlist.h

This file was deleted.

1 change: 0 additions & 1 deletion src/nrncvode/cvodeobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ struct BAMech;
struct NrnThread;
class PlayRecord;
class STEList;
class HTList;
namespace neuron {
struct model_sorted_token;
}
Expand Down
16 changes: 14 additions & 2 deletions src/nrncvode/netcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#undef check

#include "htlist.h"
#include "neuron/container/data_handle.hpp"
#include "nrnmpi.h"
#include "nrnneosm.h"
Expand Down Expand Up @@ -212,7 +211,7 @@ class ConditionEvent: public DiscreteEvent {
static unsigned long deliver_qthresh_;
};

class WatchCondition: public ConditionEvent, public HTList {
class WatchCondition: public ConditionEvent {
public:
WatchCondition(Point_process*, double (*)(Point_process*));
virtual ~WatchCondition();
Expand Down Expand Up @@ -242,6 +241,19 @@ class WatchCondition: public ConditionEvent, public HTList {

static unsigned long watch_send_;
static unsigned long watch_deliver_;

void Remove() {
if (next) {
next->prev = prev;
}
if (prev) {
prev->next = next;
}
prev = nullptr;
next = nullptr;
}
WatchCondition* next = nullptr;
WatchCondition* prev = nullptr;
};

class STECondition: public WatchCondition {
Expand Down
10 changes: 3 additions & 7 deletions src/nrncvode/netcvode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5238,14 +5238,10 @@ void ConditionEvent::abandon_statistics(Cvode* cv) {
}

WatchCondition::WatchCondition(Point_process* pnt, double (*c)(Point_process*))
: HTList(nullptr) {
pnt_ = pnt;
c_ = c;
watch_index_ = 0; // For transfer, will be a small positive integer.
}
: pnt_(pnt), c_(c), watch_index_(0)
{}

WatchCondition::~WatchCondition() {
// printf("~WatchCondition\n");
Remove();
}

Expand Down Expand Up @@ -5455,7 +5451,7 @@ void Cvode::evaluate_conditions(NrnThread* nt) {
}
}
if (z.watch_list_) {
for (auto& item: *z.watch_list_){
for (WatchCondition* item: *z.watch_list_){
item->condition(this);
}
}
Expand Down

0 comments on commit f7149cc

Please sign in to comment.