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 <map>
13#include <list>
14#include <vector>
15#include <memory>
16
17#include "codac2_Interval.h"
18
19namespace codac2
20{
21 class TSlice;
22
23 class TDomain
24 {
25 public:
26
27 explicit TDomain(const Interval& t0_tf);
28 explicit TDomain(const Interval& t0_tf, double dt, bool with_gates = false);
29 const Interval t0_tf() const; // todo: keep this method?
30 std::list<TSlice>::iterator iterator_tslice(double t); // returns it on last slice if t==t_f, not end
31 size_t nb_tslices() const;
32 size_t nb_tubes() const;
33 bool all_gates_defined() const;
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 friend std::ostream& operator<<(std::ostream& os, const TDomain& x);
37 const std::list<TSlice>& tslices() const;
38 std::list<TSlice>& tslices();
39 void delete_gates();
40 static bool are_same(const std::shared_ptr<TDomain>& tdom1, const std::shared_ptr<TDomain>& tdom2);
41
42
43 protected:
44
45 std::list<TSlice> _tslices;
46
47 template<typename U>
48 friend class Tube;
49 };
50
51 std::shared_ptr<TDomain> create_tdomain(const Interval& t0_tf = Interval(-oo,oo));
52 std::shared_ptr<TDomain> create_tdomain(const Interval& t0_tf, double dt, bool with_gates = false);
53
54}
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62