sot-core  4.11.8
Hierarchical task solver plug-in for dynamic-graph.
multi-bound.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #ifndef __SOT_MultiBound_H__
11 #define __SOT_MultiBound_H__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* STD */
18 #include <string>
19 #include <vector>
20 
21 /* SOT */
22 #include <dynamic-graph/signal-caster.h>
23 
25 
26 #include "sot/core/api.hh"
27 
28 /* --------------------------------------------------------------------- */
29 /* --- CLASS ----------------------------------------------------------- */
30 /* --------------------------------------------------------------------- */
31 
32 namespace dynamicgraph {
33 namespace sot {
34 
36  public:
37  enum MultiBoundModeType { MODE_SINGLE, MODE_DOUBLE };
38  enum SupInfType { BOUND_SUP, BOUND_INF };
39 
40  public: // protected:
42  double boundSingle;
43  double boundSup, boundInf;
44  bool boundSupSetup, boundInfSetup;
45 
46  public:
47  MultiBound(const double x = 0.);
48  MultiBound(const double xi, const double xs);
49  MultiBound(const double x, const SupInfType bound);
50  MultiBound(const MultiBound &clone);
51 
52  public: // Acessors
53  MultiBoundModeType getMode(void) const;
54  double getSingleBound(void) const;
55  double getDoubleBound(const SupInfType bound) const;
56  bool getDoubleBoundSetup(const SupInfType bound) const;
57 
58  public: // Modifiors
59  void setDoubleBound(SupInfType boundType, double boundValue);
60  void unsetDoubleBound(SupInfType boundType);
61  void setSingleBound(double boundValue);
62 
63  public:
64  SOT_CORE_EXPORT friend std::ostream &operator<<(std::ostream &os,
65  const MultiBound &m);
66  SOT_CORE_EXPORT friend std::istream &operator>>(std::istream &is,
67  MultiBound &m);
68 };
69 
70 /* --------------------------------------------------------------------- */
71 typedef std::vector<MultiBound> VectorMultiBound;
72 SOT_CORE_EXPORT std::ostream &operator<<(std::ostream &os,
73  const VectorMultiBound &v);
74 SOT_CORE_EXPORT std::istream &operator>>(std::istream &os, VectorMultiBound &v);
75 
76 } /* namespace sot */
77 
78 template <>
79 struct signal_io<sot::MultiBound> : signal_io_unimplemented<sot::MultiBound> {};
80 } /* namespace dynamicgraph */
81 
82 #endif // #ifndef __SOT_MultiBound_H__
dynamicgraph::sot::operator<<
SOT_CORE_EXPORT std::ostream & operator<<(std::ostream &os, const VectorMultiBound &v)
SOT_CORE_EXPORT
#define SOT_CORE_EXPORT
Definition: api.hh:20
dynamicgraph::sot::MultiBound::boundSup
double boundSup
Definition: multi-bound.hh:43
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::VectorMultiBound
std::vector< MultiBound > VectorMultiBound
Definition: multi-bound.hh:71
dynamicgraph::sot::MultiBound::boundSingle
double boundSingle
Definition: multi-bound.hh:42
dynamicgraph::sot::operator>>
SOT_CORE_EXPORT std::istream & operator>>(std::istream &os, VectorMultiBound &v)
dynamicgraph::sot::MultiBound::SupInfType
SupInfType
Definition: multi-bound.hh:38
api.hh
dynamicgraph::sot::MultiBound::MultiBoundModeType
MultiBoundModeType
Definition: multi-bound.hh:37
exception-task.hh
dynamicgraph::sot::MultiBound
Definition: multi-bound.hh:35
dynamicgraph::sot::MultiBound::mode
MultiBoundModeType mode
Definition: multi-bound.hh:41
dynamicgraph::sot::MultiBound::boundSupSetup
bool boundSupSetup
Definition: multi-bound.hh:44