1 #ifndef _FMATVEC_ATOM_H 2 #define _FMATVEC_ATOM_H 21 class FMATVEC_EXPORT
Atom {
35 #define FMATVEC_ATOM_MSGTYPE_SIZE 6 36 #ifndef SWIG // swig can not parse this however it is not needed for swig 37 static_assert(SIZE==FMATVEC_ATOM_MSGTYPE_SIZE,
"The proprocessor define FMATVEC_ATOM_MSGTYPE_SIZE must be equal Atom::SIZE.");
48 #ifndef SWIG // no assignment operator for swig 58 static void setCurrentMessageStream(MsgType type,
59 const std::shared_ptr<bool> &a=std::make_shared<bool>(
true),
60 const std::shared_ptr<std::ostream> &s=std::make_shared<std::ostream>(std::cout.rdbuf()));
63 void setMessageStreamActive(MsgType type,
bool activeFlag);
66 void getMessageStream(MsgType type,
67 std::shared_ptr<bool> &a,
68 std::shared_ptr<std::ostream> &s)
const;
73 void adoptMessageStreams(
const Atom *src=
nullptr);
85 return *_msgAct[type];
91 return *_msgStatic[type];
96 return *_msgActStatic[type];
102 static std::shared_ptr<std::ostream> _nullStream;
106 static std::array<std::shared_ptr<bool >, SIZE> _msgActStatic;
107 static std::array<std::shared_ptr<std::ostream>, SIZE> _msgSavedStatic;
108 static std::array<std::shared_ptr<std::ostream>, SIZE> _msgStatic;
112 std::array<std::shared_ptr<bool >, SIZE> _msgAct;
113 std::array<std::shared_ptr<std::ostream>, SIZE> _msgSaved;
114 std::array<std::shared_ptr<std::ostream>, SIZE> _msg;
118 class FMATVEC_EXPORT PrePostfixedStream :
public std::ostream {
122 PrePostfixedStream(
const std::string &prefix_,
const std::string &postfix_,
const std::function<
void(
const std::string &)> &f);
124 PrePostfixedStream(
const std::string &prefix_,
const std::string &postfix_, std::ostream &outstr_);
126 class FMATVEC_EXPORT
StringBuf :
public std::stringbuf {
128 StringBuf(
const std::string &prefix_,
const std::string &postfix_,
const std::function<
void(
const std::string &)> &f_);
133 const std::function<void(
const std::string &)> f;
static std::ostream & msgStatic(MsgType type)
Definition: atom.h:90
bool msgAct(MsgType type) const
Definition: atom.h:84
std::ostream & msg(MsgType type) const
Definition: atom.h:78
static bool msgActStatic(MsgType type)
Definition: atom.h:95
Namespace fmatvec.
Definition: _memory.cc:28
MsgType
Messages can be printed to different message types named here.
Definition: atom.h:26