flags.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_FLAGS_H
11 #define __SOT_FLAGS_H
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* STD */
18 #include <ostream>
19 #include <vector>
20 
21 /* SOT */
23 
24 #include "sot/core/api.hh"
25 
26 /* --------------------------------------------------------------------- */
27 /* --- CLASS ----------------------------------------------------------- */
28 /* --------------------------------------------------------------------- */
29 
30 namespace dynamicgraph {
31 namespace sot {
32 
34  protected:
35  std::vector<bool> flags;
37 
38  public:
39  Flags(const bool &b = false);
40  Flags(const char *flags);
41  Flags(const std::vector<bool> &flags);
42 
43  void add(const bool &b);
44 
45  Flags operator!(void) const;
46  SOT_CORE_EXPORT friend Flags operator&(const Flags &f1, const Flags &f2);
47  SOT_CORE_EXPORT friend Flags operator|(const Flags &f1, const Flags &f2);
48  Flags &operator&=(const Flags &f2);
49  Flags &operator|=(const Flags &f2);
50 
51  SOT_CORE_EXPORT friend std::ostream &operator<<(std::ostream &os,
52  const Flags &fl);
53  SOT_CORE_EXPORT friend std::istream &operator>>(std::istream &is, Flags &fl);
54  bool operator()(const int &i) const;
55 
56  operator bool(void) const;
57 
58  void unset(const unsigned int &i);
59  void set(const unsigned int &i);
60 };
61 
62 } // namespace sot
63 
64 template <>
65 struct signal_io<sot::Flags> : signal_io_unimplemented<sot::Flags> {};
66 } // namespace dynamicgraph
67 
68 #endif /* #ifndef __SOT_FLAGS_H */
SOT_CORE_EXPORT std::istream & operator>>(std::istream &os, VectorMultiBound &v)
int i
Vec3f b
CollisionRequestFlag & operator|=(CollisionRequestFlag &a, CollisionRequestFlag b)
#define SOT_CORE_EXPORT
Definition: api.hh:20
Flags operator|(const Flags &f1, const Flags &f2)
Definition: flags.cpp:97
std::vector< bool > flags
Definition: flags.hh:35
SOT_CORE_EXPORT std::ostream & operator<<(std::ostream &os, const VectorMultiBound &v)
Flags operator &(const Flags &f1, const Flags &f2)
Definition: flags.cpp:91


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26