AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
Notify.h File Reference
#include <agx/agx.h>
#include <iostream>
#include <agx/Vector.h>
#include <sstream>
#include <agx/HashTable.h>
#include <agx/Singleton.h>
#include <agx/LogStream.h>

Go to the source code of this file.

Classes

class  agx::Notify
 Class for handling logging of messages. More...
 
class  agx::NotifyCallback
 Callback class, derive from this and Register to the notify singleton to get callbacks. More...
 

Namespaces

namespace  agx
 The agx namespace contains the dynamics/math part of the AGX Dynamics API.
 

Macros

#define ADD_NOTIFY_FUNCTIONALITY_TO_CLASS()
 
#define NOTIFY()   getNotify()
 
#define NOTIFY_CLEAR()   clear()
 
#define NOTIFY_DEBUG()   setDebugStrings(::agx::Notify::NOTIFY_DEBUG, NOTIFY_POS_ARGS)
 
#define NOTIFY_END()   end()
 
#define NOTIFY_ERROR()   setDebugStrings(::agx::Notify::NOTIFY_ERROR, NOTIFY_POS_ARGS)
 
#define NOTIFY_ERROR_IF_FALSE(X, Y)   if ( !Y ) { X << X.NOTIFY_STATE(::agx::Notify::PRINT_ALL) << X.NOTIFY_ERROR() << " Test false: " << #Y <<std::endl << X.NOTIFY_END(); }
 
#define NOTIFY_ERROR_IF_nullptr(X, Y)   if ( Y == nullptr ) { X << X.NOTIFY_STATE(::agx::Notify::PRINT_ALL) << X.NOTIFY_ERROR() << " nullptr pointer: " << #Y <<std::endl << X.NOTIFY_END(); }
 
#define NOTIFY_ERROR_IF_TRUE(X, Y)   if ( Y ) { X << X.NOTIFY_STATE(::agx::Notify::PRINT_ALL) << X.NOTIFY_ERROR() << " Test true: " << #Y <<std::endl << X.NOTIFY_END(); }
 
#define NOTIFY_INFO()   setDebugStrings(::agx::Notify::NOTIFY_INFO, NOTIFY_POS_ARGS)
 
#define NOTIFY_INSTANCE()   ::agx::Notify::instance()
 
#define NOTIFY_LOG()   logOnly()
 
#define NOTIFY_POS_ARGS   __FUNCTION__,__LINE__,__FILE__
 
#define NOTIFY_STATE(X)   push().setValue(X)
 
#define NOTIFY_WARNING()   setDebugStrings(::agx::Notify::NOTIFY_WARNING, NOTIFY_POS_ARGS)
 
#define NOTIFY_WARNING_IF_FALSE(X, Y)   if ( !Y ) { X << X.NOTIFY_WARNING() << " Test false: " << #Y <<std::endl << X.NOTIFY_END(); }
 
#define NOTIFY_WARNING_IF_nullptr(X, Y)   if ( Y == nullptr ) { X << X.NOTIFY_WARNING() << " nullptr pointer: " << #Y << std::endl << X.NOTIFY_END(); }
 
#define NOTIFY_WARNING_IF_TRUE(X, Y)   if ( Y ) { X << X.NOTIFY_WARNING() << " Test true: " << #Y <<std::endl << X.NOTIFY_END(); }
 
#define THREAD_SAFE_NOTIFY   1
 

Macro Definition Documentation

◆ ADD_NOTIFY_FUNCTIONALITY_TO_CLASS

#define ADD_NOTIFY_FUNCTIONALITY_TO_CLASS ( )
Value:
public:\
void debug( const agx::String& msg ) { Notify::instance()->debug(msg); };\
void info( const agx::String& msg ) { Notify::instance()->info(msg); };\
void warning( const agx::String& msg ) { Notify::instance()->warning(msg); };\
void error( const agx::String& msg ) { Notify::instance()->error(msg); };\
protected:\
void debug( const char* function, int line, const char* file, const agx::String& msg ) { Notify::instance()->debug(function,line,file,msg); };\
void info( const char* function, int line, const char* file, const agx::String& msg ) { Notify::instance()->info(function,line,file,msg); };\
void warning( const char* function, int line, const char* file, const agx::String& msg ) { Notify::instance()->warning(function,line,file,msg); };\
void error( const char* function, int line, const char* file, const agx::String& msg ) { Notify::instance()->error(function,line,file,msg); };\
::agx::Notify::Push push() { return Notify::instance()->push(); };\
::agx::Notify::End end() { return Notify::instance()->end(); };\
agx::String setDebugStrings( ::agx::Notify::NotifyLevel l, const char* function, int line, const char* file ) { return Notify::instance()->setDebugStrings(l,function,line,file); };\
public:\
::agx::Notify& getNotify() {\
::agx::Notify* n = Notify::instance();\
return *n;\
} \
const ::agx::Notify& getNotify() const {\
::agx::Notify* n = Notify::instance();\
return *n;\
}
Class for handling logging of messages.
Definition: Notify.h:64
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)

Definition at line 418 of file Notify.h.

◆ NOTIFY

#define NOTIFY ( )    getNotify()

Definition at line 449 of file Notify.h.

◆ NOTIFY_CLEAR

#define NOTIFY_CLEAR ( )    clear()

Definition at line 456 of file Notify.h.

◆ NOTIFY_DEBUG

#define NOTIFY_DEBUG ( )    setDebugStrings(::agx::Notify::NOTIFY_DEBUG, NOTIFY_POS_ARGS)

Definition at line 450 of file Notify.h.

◆ NOTIFY_END

#define NOTIFY_END ( )    end()

Definition at line 455 of file Notify.h.

◆ NOTIFY_ERROR

#define NOTIFY_ERROR ( )    setDebugStrings(::agx::Notify::NOTIFY_ERROR, NOTIFY_POS_ARGS)

Definition at line 453 of file Notify.h.

◆ NOTIFY_ERROR_IF_FALSE

#define NOTIFY_ERROR_IF_FALSE (   X,
  Y 
)    if ( !Y ) { X << X.NOTIFY_STATE(::agx::Notify::PRINT_ALL) << X.NOTIFY_ERROR() << " Test false: " << #Y <<std::endl << X.NOTIFY_END(); }

Definition at line 465 of file Notify.h.

◆ NOTIFY_ERROR_IF_nullptr

#define NOTIFY_ERROR_IF_nullptr (   X,
  Y 
)    if ( Y == nullptr ) { X << X.NOTIFY_STATE(::agx::Notify::PRINT_ALL) << X.NOTIFY_ERROR() << " nullptr pointer: " << #Y <<std::endl << X.NOTIFY_END(); }

Definition at line 464 of file Notify.h.

◆ NOTIFY_ERROR_IF_TRUE

#define NOTIFY_ERROR_IF_TRUE (   X,
  Y 
)    if ( Y ) { X << X.NOTIFY_STATE(::agx::Notify::PRINT_ALL) << X.NOTIFY_ERROR() << " Test true: " << #Y <<std::endl << X.NOTIFY_END(); }

Definition at line 466 of file Notify.h.

◆ NOTIFY_INFO

#define NOTIFY_INFO ( )    setDebugStrings(::agx::Notify::NOTIFY_INFO, NOTIFY_POS_ARGS)

Definition at line 451 of file Notify.h.

◆ NOTIFY_INSTANCE

#define NOTIFY_INSTANCE ( )    ::agx::Notify::instance()

Definition at line 469 of file Notify.h.

◆ NOTIFY_LOG

#define NOTIFY_LOG ( )    logOnly()

Definition at line 454 of file Notify.h.

◆ NOTIFY_POS_ARGS

#define NOTIFY_POS_ARGS   __FUNCTION__,__LINE__,__FILE__

Definition at line 444 of file Notify.h.

◆ NOTIFY_STATE

#define NOTIFY_STATE (   X)    push().setValue(X)

Definition at line 457 of file Notify.h.

◆ NOTIFY_WARNING

#define NOTIFY_WARNING ( )    setDebugStrings(::agx::Notify::NOTIFY_WARNING, NOTIFY_POS_ARGS)

Definition at line 452 of file Notify.h.

◆ NOTIFY_WARNING_IF_FALSE

#define NOTIFY_WARNING_IF_FALSE (   X,
  Y 
)    if ( !Y ) { X << X.NOTIFY_WARNING() << " Test false: " << #Y <<std::endl << X.NOTIFY_END(); }

Definition at line 461 of file Notify.h.

◆ NOTIFY_WARNING_IF_nullptr

#define NOTIFY_WARNING_IF_nullptr (   X,
  Y 
)    if ( Y == nullptr ) { X << X.NOTIFY_WARNING() << " nullptr pointer: " << #Y << std::endl << X.NOTIFY_END(); }

Definition at line 460 of file Notify.h.

◆ NOTIFY_WARNING_IF_TRUE

#define NOTIFY_WARNING_IF_TRUE (   X,
  Y 
)    if ( Y ) { X << X.NOTIFY_WARNING() << " Test true: " << #Y <<std::endl << X.NOTIFY_END(); }

Definition at line 462 of file Notify.h.

◆ THREAD_SAFE_NOTIFY

#define THREAD_SAFE_NOTIFY   1

Definition at line 33 of file Notify.h.