CYCLUS
Loading...
Searching...
No Matches
blob.h
Go to the documentation of this file.
1#ifndef CYCLUS_SRC_BLOB_H_
2#define CYCLUS_SRC_BLOB_H_
3
4#include <string>
5
6namespace cyclus {
7/// A type to represent variable-length array of bytes for dumping to a cyclus
8/// output database.
9class Blob {
10 public:
11 Blob() : str_("") {}
12
13 explicit Blob(std::string s) : str_(s) {}
14
15 const std::string& str() const { return str_; }
16
17 inline std::ostream& operator<<(std::ostream& out) const {
18 return out << str();
19 }
20
21 inline bool operator<(const cyclus::Blob& rhs) const {
22 return str() < rhs.str();
23 }
24
25 inline bool operator>(const cyclus::Blob& rhs) const {
26 return !operator<(rhs) && !operator==(rhs);
27 }
28
29 inline bool operator<=(const cyclus::Blob& rhs) const {
30 return !operator>(rhs);
31 }
32
33 inline bool operator>=(const cyclus::Blob& rhs) const {
34 return !operator<(rhs);
35 }
36
37 inline bool operator==(const cyclus::Blob& rhs) const {
38 return str() == rhs.str();
39 }
40
41 inline bool operator!=(const cyclus::Blob& rhs) const {
42 return !operator==(rhs);
43 }
44
45 private:
46 std::string str_;
47};
48
49} // namespace cyclus
50
51#endif // CYCLUS_SRC_BLOB_H_
A type to represent variable-length array of bytes for dumping to a cyclus output database.
Definition blob.h:9
bool operator==(const cyclus::Blob &rhs) const
Definition blob.h:37
Blob(std::string s)
Definition blob.h:13
bool operator>(const cyclus::Blob &rhs) const
Definition blob.h:25
bool operator!=(const cyclus::Blob &rhs) const
Definition blob.h:41
const std::string & str() const
Definition blob.h:15
bool operator>=(const cyclus::Blob &rhs) const
Definition blob.h:33
std::ostream & operator<<(std::ostream &out) const
Definition blob.h:17
bool operator<=(const cyclus::Blob &rhs) const
Definition blob.h:29
bool operator<(const cyclus::Blob &rhs) const
Definition blob.h:21
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14