codac 1.5.6
Loading...
Searching...
No Matches
codac2_TDomain.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <list>
13#include <memory>
14#include "codac2_TSlice.h"
15
16namespace codac2
17{
18 class TDomain : public std::list<TSlice>
19 {
20 protected:
21
22 explicit TDomain(const Interval& t0_tf);
23 explicit TDomain(const Interval& t0_tf, double dt, bool with_gates = false);
24
25 public:
26
27 Interval t0_tf() const;
28 size_t nb_tslices() const;
29 size_t nb_tubes() const;
30 bool all_gates_defined() const;
31 std::vector<TSlice> tslices_vector() const;
32
33 std::list<TSlice>::iterator tslice(double t); // returns it on last slice if t==t_f, not end
34 std::list<TSlice>::iterator sample(double t, bool with_gate = false);
35 void sample(const Interval& t0_tf, double dt, bool with_gates = false);
36 void delete_gates();
37
38 friend std::ostream& operator<<(std::ostream& os, const TDomain& x);
39 static bool are_same(const std::shared_ptr<const TDomain>& tdom1, const std::shared_ptr<const TDomain>& tdom2);
40
41 protected:
42
43 friend std::shared_ptr<TDomain> create_tdomain(const Interval&);
44 friend std::shared_ptr<TDomain> create_tdomain(const Interval&,double,bool);
45 };
46
47 std::shared_ptr<TDomain> create_tdomain(const Interval& t0_tf = Interval(-oo,oo));
48 std::shared_ptr<TDomain> create_tdomain(const Interval& t0_tf, double dt, bool with_gates = false);
49}
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62