#include <atom.h>
Public Types | |
enum | MsgType { Info, Warn, Debug, SIZE } |
Messages can be printed to different message types named here. | |
Public Member Functions | |
BOOST_STATIC_ASSERT_MSG (SIZE==FMATVEC_ATOM_MSGTYPE_SIZE,"The proprocessor define FMATVEC_ATOM_MSGTYPE_SIZE must be equal Atom::SIZE.") | |
virtual | ~Atom () |
dtor. | |
Atom & | operator= (const Atom &) |
When a Atom is assinged do not change the messsage streams since we always use the message streams being active at ctor time. | |
void | setMessageStreamActive (MsgType type, bool active) |
Set the active flag of this object and all objects which were created using the same message stream as this object. | |
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. | |
void | adoptMessageStreams (const Atom *src=NULL) |
std::ostream & | msg (MsgType type) |
bool | msgAct (MsgType type) |
Static Public Member Functions | |
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())) |
static std::ostream & | msgStatic (MsgType type) |
static bool | msgActStatic (MsgType type) |
Protected Member Functions | |
Atom () | |
When a Atom is default constructed use the current statically set message streams. | |
Atom (const Atom &src) | |
When a Atom is copy constructed use the current statically set message streams, not the message streams from src. | |
Top level class. This is the top level class which is used for (at least) all classes which may be created using a object factory. This class contains only totally basic functionallity like streams for printing messages. No mathematical or other "none" basic content should be added here.
void fmatvec::Atom::adoptMessageStreams | ( | const Atom * | src = NULL | ) |
Adopt the message streams from src to this object. If src is NULL adopt the current (static) message streams. Normally always the streams at ctor time are used. But in some special cassed this function is usefull.
|
inline |
Return the message stream of type type. Node: If the code is performance critical you should check first whether this stream is really printed using msgAct(type). If this return false just skip the complete message.
|
inline |
Return true if the the message of type type is currently active. Note: If the code is not performance critical their is no need to check this flag. You can just print using msg(type)<<"Hello world"<<endl; and it is not really printed.
|
inlinestatic |
Same as msgAct(type). Use this function only if not object is available. This should normally not be the case.
|
inlinestatic |
Same as msg(type). Use this function only if not object is available. This should normally not be the case.
|
static |
Set the current message stream used by all subsequent created objects. type defines the message type which should be set using this call. If s is not defined, the message of type type prints to cout. If a is not defined, a new shared bool flag set to true is used. Be aware of data races in streams if objects of type Atom print messages in threads.
|
staticprivate |
|
staticprivate |
|
staticprivate |