Itasca C++ Interface
Loading...
Searching...
No Matches
ikernelbase.h
1#pragma once
2
3#include "shared/interface/signal.h"
4
5namespace itascaxd {
6 class IKernelBase {
7 public:
8 class Skip {
9 public:
10 inline bool any() const { return thingsToSkip_.size()>0; }
11 inline void skip(TType t,bool b=true);
12 inline void combine(const Skip &s) { for (auto &t : s.thingsToSkip_) skip(t,true); }
13 inline bool operator()(TType t) const { return std::find(thingsToSkip_.begin(),thingsToSkip_.end(),t)!=thingsToSkip_.end(); }
14 private:
15 FArray<TType,3> thingsToSkip_;
16 };
17
18 shared::Signal<const string &> saveModelStateSignal;
19 shared::Signal<bool> modelChangedNotice;
20 shared::Signal<bool> projectChangedNotice;
21 shared::Signal<const string &,const string &> startProcessingFile;// fullPathName, type
22 shared::Signal<const string &,const string &> stopProcessingFile; // fullPathName, type
23 shared::Signal<const string &> saveModelState; // name
24 shared::Signal<bool> cyclingChangeNotice; // When cycling starts/stops
25 shared::Signal<const string &> projectRestored;
26 shared::Signal<const string &> projectSaved;
27 shared::Signal<bool> resultsIntervalActiveChanged;
28 };
29
30 inline void IKernelBase::Skip::skip(TType t,bool b) {
31 const bool exist = operator()(t);
32 if (b and not exist)
33 thingsToSkip_.push_back(t);
34 if (not b and exist) {
35 auto it = std::remove(thingsToSkip_.begin(),thingsToSkip_.end(),t);
36 thingsToSkip_.resize(it-thingsToSkip_.begin());
37 }
38 }
39
40} // namespace itascaxd
41// EoF
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
void push_back(const T &t)
Adds a new element to the end of the array, increasing the array size by one.
Definition farray.h:83
iterator begin()
Definition farray.h:129
iterator end()
Definition farray.h:138
size_type size() const
Definition farray.h:53
Definition ikernelbase.h:8
Definition ikernelbase.h:6
void resize(size_type i, const T &t=T())
Definition farray.h:260
uint32 TType
class type indicator
Definition basedef.h:46
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:4