1 #ifndef _FMATVEC_ATOM_H
2 #define _FMATVEC_ATOM_H
6 #include <boost/shared_ptr.hpp>
7 #include <boost/make_shared.hpp>
8 #include <boost/array.hpp>
9 #include <boost/static_assert.hpp>
31 #define FMATVEC_ATOM_MSGTYPE_SIZE 3
32 #ifndef SWIG // swig can not parse this however it is not needed for swig
33 BOOST_STATIC_ASSERT_MSG(SIZE==FMATVEC_ATOM_MSGTYPE_SIZE,
"The proprocessor define FMATVEC_ATOM_MSGTYPE_SIZE must be equal Atom::SIZE.");
44 #ifndef SWIG // no assignment operator for swig
55 const boost::shared_ptr<bool> &a=boost::make_shared<bool>(
true),
56 const boost::shared_ptr<std::ostream> &s=boost::make_shared<std::ostream>(std::cout.rdbuf()));
63 boost::shared_ptr<bool> &a,
64 boost::shared_ptr<std::ostream> &s);
81 return *_msgAct[type];
87 return *_msgStatic[type];
92 return *_msgActStatic[type];
98 static boost::shared_ptr<std::ostream> _nullStream;
102 static boost::array<boost::shared_ptr<bool >, SIZE> _msgActStatic;
103 static boost::array<boost::shared_ptr<std::ostream>, SIZE> _msgSavedStatic;
104 static boost::array<boost::shared_ptr<std::ostream>, SIZE> _msgStatic;
108 boost::array<boost::shared_ptr<bool >, SIZE> _msgAct;
109 boost::array<boost::shared_ptr<std::ostream>, SIZE> _msgSaved;
110 boost::array<boost::shared_ptr<std::ostream>, SIZE> _msg;
void getMessageStream(MsgType type, boost::shared_ptr< bool > &a, boost::shared_ptr< std::ostream > &s)
Get the shared message stream active flag and the shared message stream of this object.
Definition: atom.cc:76
static std::ostream & msgStatic(MsgType type)
Definition: atom.h:86
static void setCurrentMessageStream(MsgType type, const boost::shared_ptr< bool > &a=boost::make_shared< bool >(true), const boost::shared_ptr< std::ostream > &s=boost::make_shared< std::ostream >(std::cout.rdbuf()))
Definition: atom.cc:65
std::ostream & msg(MsgType type)
Definition: atom.h:74
Atom()
When a Atom is default constructed use the current statically set message streams.
Definition: atom.cc:46
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:71
static bool msgActStatic(MsgType type)
Definition: atom.h:91
bool msgAct(MsgType type)
Definition: atom.h:80
void adoptMessageStreams(const Atom *src=NULL)
Definition: atom.cc:83
virtual ~Atom()
dtor.
Definition: atom.cc:58
MsgType
Messages can be printed to different message types named here.
Definition: atom.h:25
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:61