1 #ifndef _FMATVEC_ATOM_H
2 #define _FMATVEC_ATOM_H
14 class AdoptCurrentMessageStreamsUntilScopeExit;
23 class FMATVEC_EXPORT
Atom {
38 #define FMATVEC_ATOM_MSGTYPE_SIZE 6
39 #ifndef SWIG // swig can not parse this however it is not needed for swig
40 static_assert(SIZE==FMATVEC_ATOM_MSGTYPE_SIZE,
"The proprocessor define FMATVEC_ATOM_MSGTYPE_SIZE must be equal Atom::SIZE.");
51 #ifndef SWIG // no assignment operator for swig
61 static void setCurrentMessageStream(MsgType type,
66 void setMessageStreamActive(MsgType type,
bool activeFlag);
69 void getMessageStream(MsgType type,
76 void adoptMessageStreams(
const Atom *src=
nullptr);
88 return *_msgAct[type];
94 return *_msgStatic[type];
99 return *_msgActStatic[type];
109 static std::array<std::shared_ptr<bool >, SIZE> _msgActStatic;
110 static std::array<std::shared_ptr<std::ostream>, SIZE> _msgSavedStatic;
111 static std::array<std::shared_ptr<std::ostream>, SIZE> _msgStatic;
115 std::array<std::shared_ptr<bool >, SIZE> _msgAct;
116 std::array<std::shared_ptr<std::ostream>, SIZE> _msgSaved;
117 std::array<std::shared_ptr<std::ostream>, SIZE> _msg;
121 class FMATVEC_EXPORT PrePostfixedStream :
public std::ostream {
125 PrePostfixedStream(
const std::string &prefix_,
const std::string &postfix_,
const std::function<
void(
const std::string &)> &f);
127 PrePostfixedStream(
const std::string &prefix_,
const std::string &postfix_, std::ostream &outstr_);
131 StringBuf(std::string prefix_, std::string postfix_,
const std::function<
void(
const std::string &)> &f_);
136 const std::function<void(const std::string &)> f;
static std::ostream & msgStatic(MsgType type)
Definition: atom.h:93
bool msgAct(MsgType type) const
Definition: atom.h:87
static bool msgActStatic(MsgType type)
Definition: atom.h:98
std::ostream & msg(MsgType type) const
Definition: atom.h:81
MsgType
Messages can be printed to different message types named here.
Definition: atom.h:29