Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Namespaces | Defines | Functions
jafarMacro.hpp File Reference

Defines usefull macros. More...


Detailed Description

Defines usefull macros.

All these macro are disabled when -DJFR_NDEBUG is passed to the compiler.

Definition in file jafarMacro.hpp.

Go to the source code of this file.

Classes

struct  jafar::kernel::details::ForeachInfoBase
struct  jafar::kernel::details::ForeachInfo< T >

Namespaces

namespace  jafar
 

Transport info from GDAL Datasets to Bands' internal data.


Defines

#define _JFR_MODULE_   "jafar"
#define JFR_FOREACH(var, cont)
 This macro allow to easily loop over all the elements of a vector, without writing the annoying iterators.
#define JFR_DEFINE_PARAM_VAR(type, name)
 This macro defines the member used to store the value of a parameter.
#define JFR_DEFINE_PARAM_GETTER(type, name)
 This macro defines the function used to return the value of a parameter.
#define JFR_DEFINE_PARAM_SETTER(type, name, settername)
 This macro defines the function used to set the value of a parameter.
#define JFR_DEFINE_PARAM_RW(type, name, settername)
 This macro defines a parameter that can be read and write.
#define JFR_DEFINE_PARAM_RO(type, name)
 This macro defines a parameter that can be read, but not set.
#define JFR_PARAM_WO(type, name, settername)
 This macro defines a parameter that can only be written.
#define JAFAR_DEPRECATED
 The JAFAR_DEPRECATED macro can be used to trigger compile-time warnings when a deprecated functions are used.
#define JFR_PP_VAR(var)   #var << " = " << var << " "
 Display a variable name in a flow and its value.
#define JFR_ERROR(ExceptionName, id, message)
 Throw ExceptionName with ID id along with message.
#define JFR_GLOBAL_TRY
 general try/catch block to display the exception message and forward the exception (usually to make the program catch), but disable this in debug mode because it prevents from getting a backtrace in debuggers.
#define JFR_GLOBAL_CATCH
#define JFR_PRED_ERROR(predicate, ExceptionName, id, message)
 If the predicate is FALSE, throw ExceptionName with ID id along with message.
#define JFR_RUN_TIME(message)
 Throw a JafarException with id RUN_TIME.
#define JFR_PRED_RUN_TIME(predicate, message)
 If predicate is FALSE, throw a JafarException with id RUN_TIME.
#define JFR_IO_STREAM(predicate, message)
 If predicate is FALSE, throw a IO_STREAM jafar::kernel::JafarException.
#define JFR_NUMERIC(predicate, message)
 If predicate is FALSE, throw a NUMERIC jafar::kernel::JafarException.
#define JFR_CHECK_PARAM(predicate, param)
 If predicate is FALSE throw a jafar::kernel::InvalidParamException.
#define JFR_ASSERT(predicate, message)
 When JFR_NDEBUG is defined, contract programming checks, debug messages and trace information are disabled.
#define JFR_PRECOND(predicate, message)
 If predicate is FALSE throw a jafar::kernel::JafarException with ID PRECONDITION, along with message.
#define JFR_POSTCOND(predicate, message)
 If predicate is FALSE throw a jafar::kernel::JafarException with ID POSTCONDITION, along with message.
#define JFR_INVARIANT(predicate, message)
 If predicate is FALSE throw a jafar::kernel::JafarException with ID INVARIANT, along with message.
#define JFR_WARNING(message)
 Send message to the debug stream with level DebugStream::Warning.
#define JFR_DEBUG_BEGIN()
 Tell the debug stream to start a new line of debug.
#define JFR_DEBUG_SEND(message)
 Use after a call to JFR_DEBUG_BEGIN() to send message to the debug stream.
#define JFR_DEBUG_VSEND(message)
 Use to send a verbose message to debug stream.
#define JFR_DEBUG_VVSEND(message)
 Use to send a very verbose message to debug stream.
#define JFR_DEBUG_END()
 Use when you want to close a line of debug.
#define JFR_DEBUG(message)
 Send message to the debug stream with level DebugStream::Debug.
#define JFR_DEBUG_COND(test, message)
 Send message to the debug stream with level DebugStream::Debug, if the condition test is true.
#define JFR_VDEBUG(message)
 Send message to the debug stream with level DebugStream::VerboseDebug.
#define JFR_VVDEBUG(message)
 Send message to the debug stream with level DebugStream::VeryVerboseDebug.
#define JFR_TRACE(exception, message)
 This macro add a trace with message to exception.
#define JFR_TRACE_BEGIN
#define JFR_TRACE_END(message)
 End a trace block.
#define JFR_TRACE_POINT(message)
 shortcut for:

Functions

template<typename T >
ForeachInfo< T > jafar::kernel::details::CreateForeachInfo (const T &t)
template<typename T >
const ForeachInfo< T > * jafar::kernel::details::getForeachInfo (const ForeachInfoBase *base, const T *)
template<typename T >
T * jafar::kernel::details::getForeachType (const T &)

Define Documentation

The JAFAR_DEPRECATED macro can be used to trigger compile-time warnings when a deprecated functions are used.

For non-inline functions, the macro has to be inserted at the end of the declaration like in :

 DeprecatedConstructor() JAFAR_DEPRECATED;
 void deprecatedFunction() const JAFAR_DEPRECATED;

For inline functions, the macro has to be inserted before the declartion but after virtual or static keywoard, like in :

 JAFAR_DEPRECATED void deprecatedInline() { ... }
 virtual JAFAR_DEPRECATED int depreactedInline() { ... }
 static JAFAR_DEPRECATED char* deprecatedInline() { ... }

You can declare a class or struct to be deprecated :

 class JAFAR_DEPRECATED deprecatedClass { };
 struct JAFAR_DEPRECATED deprecatedStruct { };

Definition at line 236 of file jafarMacro.hpp.

#define JFR_ASSERT (   predicate,
  message 
)
Value:
{ \
  if (!(predicate)) {             \
    using jafar::kernel::JafarException;        \
    std::ostringstream s;           \
    s << message;             \
    s << " (" << #predicate << ")";         \
    throw JafarException(JafarException::ASSERT,      \
       s.str(),_JFR_MODULE_, __FILE__, __LINE__); \
  } \
}

When JFR_NDEBUG is defined, contract programming checks, debug messages and trace information are disabled.

If predicate is FALSE throw a jafar::kernel::JafarException with ID ASSERT, along with message.

Definition at line 402 of file jafarMacro.hpp.

Referenced by jafar::geom::cosAngleCov(), jafar::jmath::ublasExtra::delete_column(), jafar::jmath::ublasExtra::delete_columns(), jafar::jmath::ublasExtra::delete_row(), jafar::jmath::ublasExtra::delete_rows(), jafar::sift::demoWrapper(), jafar::geom::Atom< dimension >::distance(), jafar::gfm_v2::DescriptorsBasedMatcher< InterestFeatureT >::distance(), jafar::geom::Line< dimension >::EuclideanDriver::EuclideanDriver(), jafar::jmath::RANSAC< NUMTYPE >::execute(), jafar::rtslam::Gaussian::Gaussian(), jafar::rtslam::hardware::HardwareSensorAbstract< T >::getRaws(), jafar::geom::Point< dimension >::homogenousCoordinatesCov(), jafar::rtslam::RobotAbstract::init(), jafar::gfm_v2::AllTimeTracker< DESCRIPTOR >::matchWithOthers(), jafar::jmath::ublasExtra::minus_vector(), jafar::rtslam::RobotAbstract::move(), jafar::gfm_v2::CamShiftTracker::nextImage(), jafar::jmath::ublasExtra::plus_vector(), jafar::rtslam::SensorAbsloc::process(), jafar::slammm::MultiMapsSlam::processObservationsImpl(), jafar::geom::Repere< dimension >::Repere(), jafar::slam::SegmentObservation::SegmentObservation(), jafar::rtslam::Perturbation::set_from_continuous(), jafar::rtslam::Perturbation::set_P_from_continuous(), jafar::rtslam::Perturbation::set_std_continuous(), jafar::rtslam::Gaussian::std(), and jafar::geom::Repere< dimension >::vec().

#define JFR_CHECK_PARAM (   predicate,
  param 
)
Value:
{ \
  if (!(predicate)) {             \
    std::ostringstream s;           \
    s << "invalid parameter " << #param << "=" << param;    \
    s << " (" << #predicate << ")";         \
    jafar::kernel::throwInvalidParamException(param, s.str(),   \
                _JFR_MODULE_,   \
                __FILE__, __LINE__);  \
  } \
}

If predicate is FALSE throw a jafar::kernel::InvalidParamException.

Definition at line 378 of file jafarMacro.hpp.

#define JFR_DEBUG (   message)
#define JFR_DEBUG_BEGIN ( )
Value:
{                          \
    DebugStream::setup(_JFR_MODULE_, DebugStream::Debug); \
    DebugStream::sendLocation(_JFR_MODULE_, __FILE__, __LINE__); \
}

Tell the debug stream to start a new line of debug.

  JFR_DEBUG_BEGIN()
  JFR_DEBUG_SEND("The values of i are "
  for(int i = 0; i < 3; i ++)
    JFR_DEBUG_SEND( i << " "); 
  JFR_DEBUG_END()
 
 output:
  D:pipo/test.cpp:55: The value of i are 0 1 2

Definition at line 494 of file jafarMacro.hpp.

#define JFR_DEBUG_COND (   test,
  message 
)
Value:
{ \
  if( (test) ) JFR_DEBUG( message); \
}

Send message to the debug stream with level DebugStream::Debug, if the condition test is true.

operator<< can be used to format the message.

Definition at line 563 of file jafarMacro.hpp.

#define JFR_DEBUG_END ( )
Value:
{                        \
    DebugStream::instance() << jafar::debug::endl; \
}

Use when you want to close a line of debug.

Definition at line 532 of file jafarMacro.hpp.

#define JFR_DEBUG_SEND (   message)
Value:
{                                \
    DebugStream::instance() << message; \
}

Use after a call to JFR_DEBUG_BEGIN() to send message to the debug stream.

Definition at line 504 of file jafarMacro.hpp.

#define JFR_DEBUG_VSEND (   message)
Value:
{                                 \
    DebugStream::setup(_JFR_MODULE_, DebugStream::VerboseDebug, false); \
    DebugStream::instance() << message; \
    DebugStream::setup(_JFR_MODULE_, DebugStream::Debug, false); \
}

Use to send a verbose message to debug stream.

Definition at line 512 of file jafarMacro.hpp.

#define JFR_DEBUG_VVSEND (   message)
Value:
{                                 \
    DebugStream::setup(_JFR_MODULE_, DebugStream::VeryVerboseDebug, false); \
    DebugStream::instance() << message; \
    DebugStream::setup(_JFR_MODULE_, DebugStream::Debug, false); \
}

Use to send a very verbose message to debug stream.

Definition at line 522 of file jafarMacro.hpp.

#define JFR_DEFINE_PARAM_GETTER (   type,
  name 
)
Value:
public: \
     inline type name() const { return m_##name; }

This macro defines the function used to return the value of a parameter.

There is no reason to use that macro directly, you will want to use JFR_DEFINE_PARAM_RW, JFR_DEFINE_PARAM_RO or JFR_DEFINE_PARAM_WO

Parameters:
typethe type of the parameter
namethe name of the parameter

Definition at line 105 of file jafarMacro.hpp.

#define JFR_DEFINE_PARAM_RO (   type,
  name 
)
Value:
JFR_DEFINE_PARAM_GETTER(type, name) \
  JFR_DEFINE_PARAM_VAR(type,name)

This macro defines a parameter that can be read, but not set.

Exemple of use:

  class MyClass {
    public:
      MyClass( ) : m_myParam(10.0) { }
    JFR_DEFINE_PARAM_RO( double, myParam)
  };
  MyClass instance;
  JFR_DEBUG(instance.myParam())

Or if you want a personal setter

  class MyClass {
    JFR_DEFINE_PARAM_RO( double, myParam)
    public:
      MyClass( ) : m_myParam(0.0) { }
    public:
      void setMyParam(double p)
      {
        if(p < 5.0) m_myParam = p;
      }
  };
  MyClass instance;
  instance.setMyParam(10.0);
  JFR_DEBUG(instance.myParam()); // will return 0.0
Parameters:
typethe type of the parameter
namethe name of the parameter

Definition at line 179 of file jafarMacro.hpp.

#define JFR_DEFINE_PARAM_RW (   type,
  name,
  settername 
)
Value:
JFR_DEFINE_PARAM_GETTER(type, name) \
  JFR_DEFINE_PARAM_SETTER(type, name, settername ) \
  JFR_DEFINE_PARAM_VAR(type,name)

This macro defines a parameter that can be read and write.

Exemple of use:

  class MyClass {
    JFR_DEFINE_PARAM_RW( double, myParam, setMyParam);
  };
  MyClass instance;
  instance.setMyParam(10.0);
  JFR_DEBUG(instance.myParam())
Parameters:
typethe type of the parameter
namethe name of the parameter
setternamethe name of the setter (if the parameter is called myParameter, the setter is ususally called setMyParamter)

Definition at line 140 of file jafarMacro.hpp.

#define JFR_DEFINE_PARAM_SETTER (   type,
  name,
  settername 
)
Value:
public: \
     inline void settername(type v) { m_##name = v; }

This macro defines the function used to set the value of a parameter.

There is no reason to use that macro directly, you will want to use JFR_DEFINE_PARAM_RW, JFR_DEFINE_PARAM_RO or JFR_DEFINE_PARAM_WO

Parameters:
typethe type of the parameter
namethe name of the parameter
setternamethe name of the setter (if the parameter is called myParameter, the setter is ususally called setMyParamter)

Definition at line 118 of file jafarMacro.hpp.

#define JFR_DEFINE_PARAM_VAR (   type,
  name 
)
Value:
private: \
      type m_##name;

This macro defines the member used to store the value of a parameter.

There is no reason to use that macro directly, you will want to use JFR_DEFINE_PARAM_RW, JFR_DEFINE_PARAM_RO or JFR_DEFINE_PARAM_WO

Parameters:
typethe type of the parameter
namethe name of the parameter (the name of the variable is prefixed with m_)

Definition at line 94 of file jafarMacro.hpp.

#define JFR_ERROR (   ExceptionName,
  id,
  message 
)
#define JFR_FOREACH (   var,
  cont 
)
Value:
for( const jafar::kernel::details::ForeachInfoBase&  contInfo = jafar::kernel::details::CreateForeachInfo( cont ); \
       not jafar::kernel::details::getForeachInfo( &contInfo, true ? 0 : jafar::kernel::details::getForeachType(cont) )->finished(); \
       jafar::kernel::details::getForeachInfo( &contInfo, true ? 0 : jafar::kernel::details::getForeachType(cont) )->next() ) \
    for( var = *jafar::kernel::details::getForeachInfo( &contInfo, true ? 0 : jafar::kernel::details::getForeachType(cont) )->it; \
         jafar::kernel::details::getForeachInfo( &contInfo, true ? 0 : jafar::kernel::details::getForeachType(cont) )->count < 1; \
         ++jafar::kernel::details::getForeachInfo( &contInfo, true ? 0 : jafar::kernel::details::getForeachType(cont) )->count )

This macro allow to easily loop over all the elements of a vector, without writing the annoying iterators.

 std::vector\< int \> vec;
 JFR_FOREACH( int var, vec )
 {
  JFR_DEBUG( var );
 }
 std::vector\< CoolObject \> coolObjects;
 JFR_FOREACH( CoolObject& coolObject, coolObjects )
 {
  coolObject.soSomethingCool();
 }

Definition at line 75 of file jafarMacro.hpp.

#define JFR_INVARIANT (   predicate,
  message 
)
Value:
{ \
  if (!(predicate)) {             \
    using jafar::kernel::JafarException;        \
    std::ostringstream s;           \
    s << message;             \
    s << " (" << #predicate << ")";         \
    throw JafarException(JafarException::INVARIANT,     \
       s.str(),_JFR_MODULE_, __FILE__, __LINE__); \
  } \
}

If predicate is FALSE throw a jafar::kernel::JafarException with ID INVARIANT, along with message.

Definition at line 449 of file jafarMacro.hpp.

#define JFR_IO_STREAM (   predicate,
  message 
)
Value:
{ \
  if (!(predicate))             \
    {                 \
      using jafar::kernel::JafarException;        \
      std::ostringstream s;           \
      s << message;             \
      throw JafarException(JafarException::IO_STREAM,     \
         s.str(), _JFR_MODULE_, __FILE__, __LINE__);  \
  } \
}

If predicate is FALSE, throw a IO_STREAM jafar::kernel::JafarException.

example:

    void T3D::read(const std::string& fileName_) { 
      std::ifstream file(fileName_.c_str()); 
      JFR_IO_STREAM(file, "error while opening file " << fileName_); 

      JFR_TRACE_BEGIN; 
      file >> (*this); 
      JFR_TRACE_END(" (reading file:" << fileName_ << ")"); 

      file.close(); 
    } 

Definition at line 342 of file jafarMacro.hpp.

Referenced by jafar::sift::demoWrapper(), jafar::kernel::KeyValueFile::getItem(), and jafar::kernel::CSVFile::getItem().

#define JFR_NUMERIC (   predicate,
  message 
)
Value:
{ \
  if (!(predicate))             \
    {                 \
      using jafar::kernel::JafarException;        \
      std::ostringstream s;           \
      s << message;             \
      s << " (" << #predicate << ")";         \
      throw JafarException(JafarException::NUMERIC,     \
         s.str(),         \
         _JFR_MODULE_, __FILE__, __LINE__);   \
  } \
}

If predicate is FALSE, throw a NUMERIC jafar::kernel::JafarException.

example:

  JFR_NUMERIC(fabs(v(0)) > jmath::constant::EPSILON,
    "CameraPinhole::project: 3D points x is too small: " << v);

Definition at line 362 of file jafarMacro.hpp.

Referenced by jafar::camera::StereoBench::compute3dPoint(), jafar::camera::CameraBarreto::imageToCameraFrameDirection(), jafar::jmath::ublasExtra::normalize(), jafar::jmath::ublasExtra::normalized(), jafar::jmath::ublasExtra::normalizeJac(), jafar::camera::CameraPinhole::project(), and jafar::camera::CameraPinhole::projectJac().

#define JFR_PARAM_WO (   type,
  name,
  settername 
)
Value:
JFR_DEFINE_PARAM_SETTER(type, name, settername ) \
  JFR_DEFINE_PARAM_VAR(type,name)

This macro defines a parameter that can only be written.

Exemple of use:

  class MyClass {
    JFR_DEFINE_PARAM_WO( double, myParam, setMyParam)
  };
  MyClass instance;
  instance.setMyParam(10.0);
Parameters:
typethe type of the parameter
namethe name of the parameter
setternamethe name of the setter (if the parameter is called myParameter, the setter is ususally called setMyParamter)

Definition at line 200 of file jafarMacro.hpp.

#define JFR_POSTCOND (   predicate,
  message 
)
Value:
{ \
  if (!(predicate)) {             \
    using jafar::kernel::JafarException;        \
    std::ostringstream s;           \
    s << message;             \
    s << " (" << #predicate << ")";         \
    throw JafarException(JafarException::POSTCONDITION,     \
       s.str(),_JFR_MODULE_, __FILE__, __LINE__); \
  } \
}

If predicate is FALSE throw a jafar::kernel::JafarException with ID POSTCONDITION, along with message.

Definition at line 434 of file jafarMacro.hpp.

Referenced by jafar::modeler::Mixer::Mixer().

#define JFR_PP_VAR (   var)    #var << " = " << var << " "

Display a variable name in a flow and its value.

For instance:

 int a = 1;
 JFR_DEBUG( JFR_PP_VAR( a ) );

will display "a = 1 ".

Definition at line 253 of file jafarMacro.hpp.

#define JFR_PRECOND (   predicate,
  message 
)
Value:
{ \
  if (!(predicate)) {             \
    using jafar::kernel::JafarException;        \
    std::ostringstream s;           \
    s << message;             \
    s << " (" << #predicate << ")";         \
    throw JafarException(JafarException::PRECONDITION,      \
       s.str(),_JFR_MODULE_, __FILE__, __LINE__); \
  } \
}

If predicate is FALSE throw a jafar::kernel::JafarException with ID PRECONDITION, along with message.

Definition at line 418 of file jafarMacro.hpp.

Referenced by jafar::ddfsimu::AcceleroSimu< Bayesian_filter::Linear_correlated_observe_model >::AcceleroSimu(), jafar::model3d::RANSAC< ModelType >::Algorithm(), jafar::textures::Attributes::at(), jafar::filter::BaseKalmanFilter::checkConsistency(), jafar::slam::EulerTools::composeFrame(), jafar::slam::EulerTools::composeFrameJac(), jafar::correl::FastZncc::compute(), jafar::camera::StereoBench::compute3dPoint(), jafar::correl::FastZncc::computeChar(), jafar::slam::OdoNoiseModel::computeCov(), jafar::filter::JacobianObserveModel::computeInnovation(), jafar::filter::BlockObserveModel::computeInnovation(), jafar::jmath::ublasExtra::crossProd(), jafar::slam::EulerTools::fromFrame(), jafar::slam::EulerTools::fromFrameJac(), jafar::model3d::RANSAC< ModelType >::generateRandomSample(), jafar::bundle::bundleVariables< Sensor >::getCPDV(), jafar::bundle::bundleVariables< Sensor >::getObj3D(), jafar::image::Pyramid::getPixelValue(), jafar::image::Image::getPixelValue(), jafar::image::Pyramid::getSubPixelValue(), jafar::image::Image::getSubPixelValue(), jafar::camera::CameraBarreto::imageToCameraFrame(), jafar::camera::CameraPinhole::imageToCameraFrame(), jafar::camera::CameraPinhole::imageToCameraFrameDirection(), jafar::camera::CameraPinhole::imageToCameraFrameDirectionJac(), jafar::camera::CameraPinhole::imageToCameraFrameJac(), jafar::quasidense::imgDataCensus::imgDataCensus(), jafar::quasidense::imgDataRank::imgDataRank(), jafar::quasidense::imgDataZncc::imgDataZncc(), jafar::model3d::Image3DTemplate< PointType >::initialize(), jafar::gfm_v2::AllTimeTracker< DESCRIPTOR >::initTracking(), jafar::hpm::TrackingEngine::initTracking(), jafar::jmath::ublasExtra::inner_prodJac(), jafar::slam::EulerTools::invFrame(), jafar::slam::EulerTools::lineFromFrame(), jafar::slam::EulerTools::lineFromFrameJac(), jafar::slam::EulerTools::lineToFrame(), jafar::slam::EulerTools::lineToFrameJac(), jafar::jmath::ublasExtra::lu_det(), jafar::jmath::ublasExtra::lu_inv(), jafar::gfm_v2::AllTimeTracker< DESCRIPTOR >::nextImage(), jafar::jmath::ublasExtra::norm_2(), jafar::jmath::ublasExtra::normalizeJac(), jafar::quasidense::omniDataCensus::omniDataCensus(), jafar::jmath::matofmat< double, 2, 6 >::operator()(), jafar::camera::pixelCyl2pixelPano(), jafar::slam::EulerTools::planeFromFrame(), jafar::slam::EulerTools::planeFromFrameJac(), jafar::slam::EulerTools::planeToFrame(), jafar::slam::EulerTools::planeToFrameJac(), jafar::geom::t3d::pointFromFrame(), jafar::geom::t3d::pointFromFrameJac(), jafar::geom::t3d::pointFromFrameJacEuler(), jafar::geom::t3d::pointFromFrameJacQuaternion(), jafar::geom::t3d::pointToFrame(), jafar::geom::t3d::pointToFrameJac(), jafar::geom::t3d::pointToFrameJacEuler(), jafar::geom::t3d::pointToFrameJacQuaternion(), jafar::bundle::bundleLinearSys::processData(), jafar::jmath::ublasExtra::prod_JPJt(), jafar::jmath::ublasExtra::prod_xt_iP_x(), jafar::jmath::ublasExtra::prod_xt_P_x(), jafar::camera::CameraPinhole::project(), jafar::camera::CameraPinhole::projectH(), jafar::bundle::bundleVariables< Sensor >::projection(), jafar::bundle::bundleVariables< Sensor >::projectionJac(), jafar::camera::CameraPinhole::projectJac(), jafar::ddf::SensorNodeGeneric< PARAMS >::PurgeFifo(), jafar::quasidense::rotDataCensus::rotDataCensus(), jafar::helloworld::HelloWorld::setHello(), jafar::image::Image::setPixelValue(), jafar::slam::EulerTools::toFrame(), jafar::slam::EulerTools::toFrameJac(), jafar::jmath::ublasExtra::trace(), jafar::hpm::TrackingEngine::track(), jafar::camera::univReprojectionCylindric(), jafar::camera::univReprojectionPerspective(), and jafar::bundle::bundleVariables< Sensor >::update().

#define JFR_PRED_ERROR (   predicate,
  ExceptionName,
  id,
  message 
)
Value:
{ \
  if (!(predicate)) {             \
    std::ostringstream s;           \
    s << message;             \
    s << " (" << #predicate << ")";         \
    throw ExceptionName(id, s.str(), __FILE__, __LINE__);   \
  } \
}

If the predicate is FALSE, throw ExceptionName with ID id along with message.

The constructor of the class ExceptionName must have signature compatible with ExceptionName(id, message, __FILE__, __LINE__). This is the case for the exception class which is generated with a module, but may not be the case for user defined exceptions.

Definition at line 290 of file jafarMacro.hpp.

Referenced by jafar::kernel::KeyValueFile::getItem(), jafar::kernel::CSVFile::getItem(), jafar::bundler::ViewsManager2::insertPixel(), jafar::jmath::matrix_file< T >::loadCSVFile(), jafar::jmath::vector_file< T >::loadCSVFile(), jafar::bundler::ViewsManager2::refByIndex(), jafar::bundler::Adapter< TRACKERS >::removeOutliers(), and jafar::kernel::CSVFile::setItem().

#define JFR_PRED_RUN_TIME (   predicate,
  message 
)
Value:
{ \
  if (!(predicate)) {             \
    using jafar::kernel::JafarException;        \
    std::ostringstream s;           \
    s << message;             \
    s << " (" << #predicate << ")";         \
    throw JafarException(JafarException::RUN_TIME,      \
       s.str(),_JFR_MODULE_, __FILE__, __LINE__); \
  } \
}

If predicate is FALSE, throw a JafarException with id RUN_TIME.

Definition at line 314 of file jafarMacro.hpp.

#define JFR_RUN_TIME (   message)
Value:
{                 \
    using jafar::kernel::JafarException;        \
    std::ostringstream s;           \
    s << message;             \
    throw JafarException(JafarException::RUN_TIME,      \
       s.str(),_JFR_MODULE_, __FILE__, __LINE__); \
  }

Throw a JafarException with id RUN_TIME.

Definition at line 302 of file jafarMacro.hpp.

Referenced by jafar::model3d::RANSAC< ModelType >::Algorithm(), jafar::geom::t3d::pointFromFrameJac(), jafar::geom::t3d::pointToFrameJac(), and jafar::simu::RobotPoseAnalysis::writeLogHeader().

#define JFR_TRACE (   exception,
  message 
)
Value:
{                 \
    std::ostringstream s;           \
    s << message;             \
    exception.addTrace(_JFR_MODULE_, __FILE__, __LINE__, s.str());  \
  }

This macro add a trace with message to exception.

exception must be a jafar::kernel::Exception (all jafar exceptions normally are !). example:

    void T3D::read(const std::string& filename_) { 
      std::ifstream file(filename_.c_str()); 
      JFR_IO_STREAM(file, "error while opening file " + filename_); 
      try { 
        file >> (*this); 
      }
      catch(jafar::kernel::Exception& e) { 
        JFR_TRACE(e," (reading file:" + filename_ + ")"); 
        throw; 
      } 
      file.close(); 
    } 

Definition at line 612 of file jafarMacro.hpp.

#define JFR_TRACE_END (   message)
#define JFR_TRACE_POINT (   message)
Value:
JFR_TRACE_END(message);           \
  JFR_TRACE_BEGIN

shortcut for:

Definition at line 665 of file jafarMacro.hpp.

#define JFR_VDEBUG (   message)
Value:
{                 \
    DebugStream::setup(_JFR_MODULE_, DebugStream::VerboseDebug);  \
    DebugStream::sendLocation(_JFR_MODULE_, __FILE__, __LINE__);  \
    DebugStream::instance() << message          \
          << jafar::debug::endl;      \
  }

Send message to the debug stream with level DebugStream::VerboseDebug.

operator<< can be used to format the message.

Definition at line 573 of file jafarMacro.hpp.

Referenced by jafar::ddf::SensorNodeGeneric< PARAMS >::FeedWithSensorData(), jafar::helloworld::HelloWorld::HelloWorld(), jafar::ddf::SensorNodeGeneric< PARAMS >::PurgeFifo(), jafar::ddf::SensorNodeIPC< PARAMS >::RequestConnection(), and jafar::helloworld::HelloWorld::~HelloWorld().

#define JFR_VVDEBUG (   message)
Value:
{                 \
    DebugStream::setup(_JFR_MODULE_, DebugStream::VeryVerboseDebug);  \
    DebugStream::sendLocation(_JFR_MODULE_, __FILE__, __LINE__);  \
    DebugStream::instance() << message          \
          << jafar::debug::endl;      \
  }

Send message to the debug stream with level DebugStream::VeryVerboseDebug.

operator<< can be used to format the message.

Definition at line 585 of file jafarMacro.hpp.

#define JFR_WARNING (   message)
Value:
{                 \
      DebugStream::setup(_JFR_MODULE_, DebugStream::Warning);   \
      DebugStream::sendLocation(_JFR_MODULE_, __FILE__, __LINE__);  \
      DebugStream::instance() << message        \
            << jafar::debug::endl;      \
    }

Send message to the debug stream with level DebugStream::Warning.

operator<< can be used to format the message.

  if (d < EPSILON)
    JFR_WARING("Small value, check numerical stability - d=" << d); 

 output:
  W:pipo/test.cpp:55: Small value, check numerical stability - d= 1e-12 

Definition at line 473 of file jafarMacro.hpp.

Referenced by jafar::bundle::bundleVariables< Sensor >::bundleVariables(), jafar::traversability::Core::getTrv(), jafar::sams::DOGDetector::loadKeyValueFile(), jafar::sams::SHDetector::loadKeyValueFile(), jafar::ddf::SensorNodeGeneric< PARAMS >::PurgeFifo(), jafar::sams::DOGDetector::saveKeyValueFile(), jafar::sams::SHDetector::saveKeyValueFile(), and jafar::image::Capture::setCamera().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:29 for Jafar by doxygen 1.7.6.1
LAAS-CNRS