1 #ifndef _FMATVEC_ATOM_H
2 #define _FMATVEC_ATOM_H
29 #define FMATVEC_ATOM_MSGTYPE_SIZE 3
30 #ifndef SWIG // swig can not parse this however it is not needed for swig
31 static_assert(SIZE==FMATVEC_ATOM_MSGTYPE_SIZE,
"The proprocessor define FMATVEC_ATOM_MSGTYPE_SIZE must be equal Atom::SIZE.");
42 #ifndef SWIG // no assignment operator for swig
53 const std::shared_ptr<bool> &a=std::make_shared<bool>(
true),
54 const std::shared_ptr<std::ostream> &s=std::make_shared<std::ostream>(std::cout.rdbuf()));
61 std::shared_ptr<bool> &a,
62 std::shared_ptr<std::ostream> &s);
79 return *_msgAct[type];
85 return *_msgStatic[type];
90 return *_msgActStatic[type];
96 static std::shared_ptr<std::ostream> _nullStream;
100 static std::array<std::shared_ptr<bool >, SIZE> _msgActStatic;
101 static std::array<std::shared_ptr<std::ostream>, SIZE> _msgSavedStatic;
102 static std::array<std::shared_ptr<std::ostream>, SIZE> _msgStatic;
106 std::array<std::shared_ptr<bool >, SIZE> _msgAct;
107 std::array<std::shared_ptr<std::ostream>, SIZE> _msgSaved;
108 std::array<std::shared_ptr<std::ostream>, SIZE> _msg;
static std::ostream & msgStatic(MsgType type)
Definition: atom.h:84
static void setCurrentMessageStream(MsgType type, const std::shared_ptr< bool > &a=std::make_shared< bool >(true), const std::shared_ptr< std::ostream > &s=std::make_shared< std::ostream >(std::cout.rdbuf()))
Definition: atom.cc:64
std::ostream & msg(MsgType type)
Definition: atom.h:72
Atom()
When a Atom is default constructed use the current statically set message streams.
Definition: atom.cc:45
void getMessageStream(MsgType type, std::shared_ptr< bool > &a, std::shared_ptr< std::ostream > &s)
Get the shared message stream active flag and the shared message stream of this object.
Definition: atom.cc:75
void setMessageStreamActive(MsgType type, bool active)
Set the active flag of this object and all objects which were created using the same message stream a...
Definition: atom.cc:70
static bool msgActStatic(MsgType type)
Definition: atom.h:89
bool msgAct(MsgType type)
Definition: atom.h:78
void adoptMessageStreams(const Atom *src=NULL)
Definition: atom.cc:82
virtual ~Atom()
dtor.
Definition: atom.cc:57
MsgType
Messages can be printed to different message types named here.
Definition: atom.h:23
Atom & operator=(const Atom &)
When a Atom is assinged do not change the messsage streams since we always use the message streams be...
Definition: atom.cc:60