sot-core  4.11.6
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 "sot/core/api.hh"
23 #include <dynamic-graph/signal-caster.h>
25 
26 /* --------------------------------------------------------------------- */
27 /* --- CLASS ----------------------------------------------------------- */
28 /* --------------------------------------------------------------------- */
29 
30 namespace dynamicgraph {
31 namespace sot {
32 
34 public:
35  enum MultiBoundModeType { MODE_SINGLE, MODE_DOUBLE };
36  enum SupInfType { BOUND_SUP, BOUND_INF };
37 
38 public: // protected:
40  double boundSingle;
41  double boundSup, boundInf;
42  bool boundSupSetup, boundInfSetup;
43 
44 public:
45  MultiBound(const double x = 0.);
46  MultiBound(const double xi, const double xs);
47  MultiBound(const double x, const SupInfType bound);
48  MultiBound(const MultiBound &clone);
49 
50 public: // Acessors
51  MultiBoundModeType getMode(void) const;
52  double getSingleBound(void) const;
53  double getDoubleBound(const SupInfType bound) const;
54  bool getDoubleBoundSetup(const SupInfType bound) const;
55 
56 public: // Modifiors
57  void setDoubleBound(SupInfType boundType, double boundValue);
58  void unsetDoubleBound(SupInfType boundType);
59  void setSingleBound(double boundValue);
60 
61 public:
62  SOT_CORE_EXPORT friend std::ostream &operator<<(std::ostream &os,
63  const MultiBound &m);
64  SOT_CORE_EXPORT friend std::istream &operator>>(std::istream &is,
65  MultiBound &m);
66 };
67 
68 /* --------------------------------------------------------------------- */
69 typedef std::vector<MultiBound> VectorMultiBound;
70 SOT_CORE_EXPORT std::ostream &operator<<(std::ostream &os,
71  const VectorMultiBound &v);
72 SOT_CORE_EXPORT std::istream &operator>>(std::istream &os, VectorMultiBound &v);
73 
74 } /* namespace sot */
75 
76 template <>
77 struct signal_io<sot::MultiBound> : signal_io_unimplemented<sot::MultiBound> {};
78 } /* namespace dynamicgraph */
79 
80 #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:41
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::VectorMultiBound
std::vector< MultiBound > VectorMultiBound
Definition: multi-bound.hh:69
dynamicgraph::sot::MultiBound::boundSingle
double boundSingle
Definition: multi-bound.hh:40
dynamicgraph::sot::operator>>
SOT_CORE_EXPORT std::istream & operator>>(std::istream &os, VectorMultiBound &v)
dynamicgraph::sot::MultiBound::SupInfType
SupInfType
Definition: multi-bound.hh:36
api.hh
dynamicgraph::sot::MultiBound::MultiBoundModeType
MultiBoundModeType
Definition: multi-bound.hh:35
exception-task.hh
dynamicgraph::sot::MultiBound
Definition: multi-bound.hh:33
dynamicgraph::sot::MultiBound::mode
MultiBoundModeType mode
Definition: multi-bound.hh:39
dynamicgraph::sot::MultiBound::boundSupSetup
bool boundSupSetup
Definition: multi-bound.hh:42