bpp-core3  3.0.0
BppBoolean.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_BPPBOOLEAN_H
6 #define BPP_BPPBOOLEAN_H
7 
8 #include <ostream>
9 
10 #include "Clonable.h"
11 
12 namespace bpp
13 {
17 class BppBoolean : public virtual Clonable
18 {
19 private:
20  bool value_;
21 
22 public:
23  BppBoolean(bool value = false)
24  : value_(value)
25  {}
26 
27  BppBoolean* clone() const { return new BppBoolean(*this); }
28 
29  const bool getValue() const { return value_; }
30 };
31 
32 inline std::ostream& operator<<(std::ostream& out, const BppBoolean& s) { return out << s.getValue(); }
33 } // namespace bpp
34 #endif // BPP_BPPBOOLEAN_H
BppBoolean * clone() const
Create a copy of this object and send a pointer to it.
Definition: BppBoolean.h:27
BppBoolean(bool value=false)
Definition: BppBoolean.h:23
std::ostream & operator<<(std::ostream &out, const BppBoolean &s)
Definition: BppBoolean.h:32
const bool getValue() const
Definition: BppBoolean.h:29
The BppBoolean object class. This class extends the bool type to support the Clonable interface...
Definition: BppBoolean.h:17
The Clonable interface (allow an object to be cloned).
Definition: Clonable.h:63