Macros
Macros

Macros

#define ecl_assert_throw(expression, exception)   if ( !(expression) ) { throw exception; }
 Debug mode throw with a logical condition check. More...
 
#define ecl_assert_throw_decl(exception)   throw(exception)
 Assure throw exception declaration. More...
 
#define ecl_catch(exception)   catch(exception)
 The catch part of a try-catch macro matching ecl_throw calls. More...
 
#define ecl_compile_time_concept_check(Model)   enum { ecl_concept_check_name(__LINE__) = ecl::concepts::CONCEPT_CHECK< Model >::instantiate }
 Compile time concept checking assertion. More...
 
#define ecl_compile_time_concept_test(Model)
 Convenient notational macro for setting up a concept testing function. More...
 
#define ECL_CXX11_NOT_FOUND
 C++11 support is available. More...
 
#define ecl_debug_catch(exception)   catch(exception)
 The catch part of a try-catch macro matching ecl_debug_throw/ecl_assert_throw calls. More...
 
#define ecl_debug_throw(exception)   throw exception;
 Debug mode exception throw. More...
 
#define ecl_debug_throw_decl(exception)   throw(exception)
 Debug mode throw exception declaration. More...
 
#define ecl_debug_try   try
 The try part of a try-catch macro matching ecl_debug_throw/ecl_assert_throw calls. More...
 
#define ECL_DEPRECATED
 Deprecated compiler warnings. More...
 
#define ECL_DONT_INLINE
 Prevents a function from being inlined. More...
 
#define ECL_HAS_CLOCK_MONOTONIC
 Can utilise monotonic clocks. More...
 
#define ECL_HAS_CPUTIME
 Can set clocks measuring time spent on the cpu (-lrt). More...
 
#define ECL_HAS_POSIX_THREADS
 Platform uses posix threads. More...
 
#define ECL_HAS_RT_TIMERS
 Ecl uses the real time (-lrt) timers. More...
 
#define ECL_HAS_SHARED_LIBS   1
 Ecl exceptions are disabled. More...
 
#define ECL_IS_POSIX
 Platform is posix-based. More...
 
#define ECL_PRIVATE_HAS_CLOCK_GETTIME
 The platform has clock_gettime() from -lrt. More...
 
#define ECL_PRIVATE_HAS_CLOCK_NANOSLEEP
 The platform has clock_nanosleep() from -lrt. More...
 
#define ECL_SIZE_OF_CHAR   1
 Defines the number of bytes for a char type. More...
 
#define ECL_SIZE_OF_DOUBLE   8
 Defines the number of bytes for a double type. More...
 
#define ECL_SIZE_OF_FLOAT   4
 Defines the number of bytes for a float type. More...
 
#define ECL_SIZE_OF_INT   4
 Defines the number of bytes for a int type. More...
 
#define ECL_SIZE_OF_LONG   8
 Defines the number of bytes for a long type. More...
 
#define ECL_SIZE_OF_LONG_DOUBLE   16
 Defines the number of bytes for a long double type. More...
 
#define ECL_SIZE_OF_LONG_LONG   8
 Defines the number of bytes for a long long type. More...
 
#define ECL_SIZE_OF_SHORT   2
 Defines the number of bytes for a short type. More...
 
#define ecl_throw(exception)   throw exception;
 Standard ecl throw exception throw. More...
 
#define ecl_throw_decl(exception)   throw(exception)
 Standard ecl throw exception declaration. More...
 
#define ecl_try   try
 The try part of a try-catch macro matching ecl_throw calls. More...
 
#define FLUSH(logStream)
 Enables flushing of log streams. More...
 
#define LOC   __FILE__ ":" TOSTRING(__LINE__) " "
 Stringify the line of code you are at. More...
 
#define LOG(logStream, mode)
 Enables log streaming. More...
 

Detailed Description

Macros that characterise the platform's time implementation.

Macro Definition Documentation

#define ecl_assert_throw (   expression,
  exception 
)    if ( !(expression) ) { throw exception; }

Debug mode throw with a logical condition check.

Does a simple logical check before throwing, only works if NDEBUG is not defined.

See also
Exceptions Guide.

Definition at line 129 of file ecl/exceptions/macros.hpp.

#define ecl_assert_throw_decl (   exception)    throw(exception)

Assure throw exception declaration.

Use when declaring a function that throws the assert mode exceptions. If NDEBUG is not defined, this simply inserts the required exception statement, otherwise it inserts nothing. This is exactly the same as the ecl_debug_throw_decl, but added here for convenience as its confusing to have to use the ecl_debug_throw_decl when also using ecl_assert_throw.

See also
ecl_assert_throw, Exceptions Guide.

Definition at line 120 of file ecl/exceptions/macros.hpp.

#define ecl_catch (   exception)    catch(exception)

The catch part of a try-catch macro matching ecl_throw calls.

See also
ecl_throw, Exceptions Guide.

Definition at line 86 of file ecl/exceptions/macros.hpp.

#define ecl_compile_time_concept_check (   Model)    enum { ecl_concept_check_name(__LINE__) = ecl::concepts::CONCEPT_CHECK< Model >::instantiate }

Compile time concept checking assertion.

This macro checks a class to verify if it conforms to a compile time metaprogramming concept.

Usage:

The input argument to this macro function is the concept class type with the testing class as its template parameter.

1 ecl_compile_time_concept_check(MyConcept<A>);

Definition at line 92 of file ecl/concepts/macros.hpp.

#define ecl_compile_time_concept_test (   Model)
Value:
~Model()
#define ecl_compile_time_concept_check(Model)
Compile time concept checking assertion.

Convenient notational macro for setting up a concept testing function.

The actual mechanics of concept testing has to be implemented in the concept class' destructor. This macro is purely just a notational convenience that makes it clear when programming the precise meaning of what is intended for your concept class.

Usage:

1 class MyConcept {
2  public:
3  ecl_compile_time_concept_test(MyConcept)
4  {
5  // compile time concept checks here.
6  }
7 };

Definition at line 116 of file ecl/concepts/macros.hpp.

#define ECL_CXX11_NOT_FOUND

C++11 support is available.

This is a very dodgy way of checking - haven't tested across compilers very well, and it doesn't take into account the partial completeness of the implementations.

It does however, provide a way for headers to use c++11 symbols in a non-destructive way for users (we often define typedefs for shared ptr variations).

Definition at line 61 of file ecl/config/macros.hpp.

#define ecl_debug_catch (   exception)    catch(exception)

The catch part of a try-catch macro matching ecl_debug_throw/ecl_assert_throw calls.

See also
ecl_assert_throw, ecl_debug_throw, Exceptions Guide.

Definition at line 161 of file ecl/exceptions/macros.hpp.

#define ecl_debug_throw (   exception)    throw exception;

Debug mode exception throw.

Use when throwing a debug mode only (NDEBUG is not defined) exception. This simply inserts the required exception constructor, otherwise it inserts nothing.

See also
ecl_debug_throw_decl, Exceptions Guide.

Definition at line 149 of file ecl/exceptions/macros.hpp.

#define ecl_debug_throw_decl (   exception)    throw(exception)

Debug mode throw exception declaration.

Use when declaring a function that throws the debug mode exceptions. If NDEBUG is not defined, this simply inserts the required exception statement, otherwise it inserts nothing.

See also
ecl_debug_throw, Exceptions Guide.

Definition at line 139 of file ecl/exceptions/macros.hpp.

#define ecl_debug_try   try

The try part of a try-catch macro matching ecl_debug_throw/ecl_assert_throw calls.

See also
ecl_assert_throw, ecl_debug_throw, Exceptions Guide.

Definition at line 155 of file ecl/exceptions/macros.hpp.

#define ECL_DEPRECATED

Deprecated compiler warnings.

The following macro emits deprecated compiler warnings by both gnu or msvc compilers.

1 ELC_DEPRECATED void f() { std::cout << "Dude" << std::endl; }

Definition at line 85 of file ecl/config/macros.hpp.

#define ECL_DONT_INLINE

Prevents a function from being inlined.

The following macro prevents functions from being inlined by both gnu or msvc compilers.

1 ELC_DONT_INLINE void f() { std::cout << "Dude" << std::endl; }

Definition at line 44 of file ecl/config/macros.hpp.

#define ECL_HAS_CLOCK_MONOTONIC

Can utilise monotonic clocks.

These come with -lrt and allow use of timers which are guaranteed not to jump.

Definition at line 58 of file time_lite/config.hpp.

#define ECL_HAS_CPUTIME

Can set clocks measuring time spent on the cpu (-lrt).

Definition at line 64 of file time_lite/config.hpp.

#define ECL_HAS_POSIX_THREADS

Platform uses posix threads.

Platform is using the posix thread model. Other thread models:

  • ECL_HAS_WIN32_THREADS

Definition at line 77 of file ecl.hpp.

#define ECL_HAS_RT_TIMERS

Ecl uses the real time (-lrt) timers.

This assumption was made by checking for the presence of clock_gettime, and clock_nanosleep. See also:

  • ECL_HAS_WIN_TIMERS
  • ECL_HAS_MACH_TIMERS
  • ECL_HAS_POSIX_TIMERS

Definition at line 99 of file time_lite/config.hpp.

#define ECL_HAS_SHARED_LIBS   1

Ecl exceptions are disabled.

By default, ecl builds all its libraries with exceptions enabled. These can be disabled by passing -DECL_DISABLE_EXCEPTIONS:bool=true to cmake, or, if building in ros, setting this variable in $ROS_ROOT/rosconfig.cmake to be true.

Defined if ecl was built as shared libraries.

If both shared and static ecl libs are present on the system, the user should predefine this if they wish to use ecl's shared libraries.

Definition at line 141 of file ecl.hpp.

#define ECL_IS_POSIX

Platform is posix-based.

Platform is based on a variant of posix. Other platforms:

  • ECL_IS_WIN32
  • ECL_IS_APPLE

Definition at line 56 of file ecl.hpp.

#define ECL_PRIVATE_HAS_CLOCK_GETTIME

The platform has clock_gettime() from -lrt.

Definition at line 39 of file time_lite/config.hpp.

#define ECL_PRIVATE_HAS_CLOCK_NANOSLEEP

The platform has clock_nanosleep() from -lrt.

Definition at line 45 of file time_lite/config.hpp.

#define ECL_SIZE_OF_CHAR   1

Defines the number of bytes for a char type.

Definition at line 91 of file ecl.hpp.

#define ECL_SIZE_OF_DOUBLE   8

Defines the number of bytes for a double type.

Definition at line 115 of file ecl.hpp.

#define ECL_SIZE_OF_FLOAT   4

Defines the number of bytes for a float type.

Definition at line 111 of file ecl.hpp.

#define ECL_SIZE_OF_INT   4

Defines the number of bytes for a int type.

Definition at line 99 of file ecl.hpp.

#define ECL_SIZE_OF_LONG   8

Defines the number of bytes for a long type.

Definition at line 103 of file ecl.hpp.

#define ECL_SIZE_OF_LONG_DOUBLE   16

Defines the number of bytes for a long double type.

Definition at line 119 of file ecl.hpp.

#define ECL_SIZE_OF_LONG_LONG   8

Defines the number of bytes for a long long type.

Definition at line 107 of file ecl.hpp.

#define ECL_SIZE_OF_SHORT   2

Defines the number of bytes for a short type.

Definition at line 95 of file ecl.hpp.

#define ecl_throw (   exception)    throw exception;

Standard ecl throw exception throw.

Use when throwing a function that throws a normal exception. If ECL_DISABLE_EXCEPTIONS is not defined, this simply inserts the required exception constructor otherwise it inserts nothing.

See also
ecl_throw_decl, Exceptions Guide.

Definition at line 74 of file ecl/exceptions/macros.hpp.

#define ecl_throw_decl (   exception)    throw(exception)

Standard ecl throw exception declaration.

Use when declaring a function that throws a normal exception. If ECL_DISABLE_EXCEPTIONS is not defined, this simply inserts the required exception statement, otherwise it inserts nothing.

See also
ecl_debug_throw, Exceptions Guide.

Definition at line 64 of file ecl/exceptions/macros.hpp.

#define ecl_try   try

The try part of a try-catch macro matching ecl_throw calls.

See also
ecl_throw, Exceptions Guide.

Definition at line 80 of file ecl/exceptions/macros.hpp.

#define FLUSH (   logStream)
Value:
if ( !logStream.isEnabled() ) {} \
else { logStream.flush(); }

Enables flushing of log streams.

Use this with LOG and LogStream to flush the stream to the shared file.

See also
LogStream.

Definition at line 56 of file log_stream.hpp.

#define LOC   __FILE__ ":" TOSTRING(__LINE__) " "

Stringify the line of code you are at.

This uses a couple of simpler string macros to indicate in which file and at what line this piece of code is at.

Definition at line 67 of file ecl/errors/macros.hpp.

#define LOG (   logStream,
  mode 
)
Value:
if ( !logStream.isModeEnabled(mode) ) {} \
else logStream.log(mode)

Enables log streaming.

Simply use this alongside LogStream's << operator - it will provide the usual text stream functionality, but additionally provides the ability to insert header/timestamp information automatically into the beginning of the stream.

See also
LogStream.

Definition at line 43 of file log_stream.hpp.



xbot_driver
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:27:38