Preprocessor definitions

In yasmine a couple preprocessor definitions can be used to customize build, compile, and run behavior. Refer to the following tables which explain all of them:

Definition

Description

Y_NO_LOGGING

Use when you want to use no logging at all (no logging code is created).

Y_NO_STD_MAKE_UNIQUE

When the standard make_unique is not available (e.g. no C++14 support), you have to define this preprocessor definition. A yasmine drop-in replacement template will be used instead then.

Y_LEAN_AND_MEAN

If you compile the library with Y_LEAN_AND_MEAN being defined or if you define the macro locally before including yasmine.hpp, all the state pseudostates and the asynchronous simple state (with the asynchronous behavior) are excluded (i.e. those headers are not included). This can reduce compile time.

Y_PROFILER

If this is defined, the state machine will count the number of events that were processed. The user can query the counter by calling the 'get_number_of_processed_events' method.

Y_CPP03_BOOST

Defining this, will set yasmine to be C++03 compatible. Additional information is available on the building yasmine page.

Note: starting with version 0.6.0, yasmine supports C++03.

Y_NO_WINDOWS_H

Directive for yasmine not to include "windows.h". This can be used if the header needs to be included manually or is included by another framework with a special configuration.

Optimization

There are also preprocessor definitions for performance optimization.

Definition

Description

Y_OPTIMIZE_4_SPEED

Optimize yasmine for speed. Certain information is cached and not calculated repeatedly on the fly.

Y_OPTIMIZE_4_SIZE

Used for memory optimization. Certain information is not cached and will be calculated repeatedly on the fly.

Obviously the two performance macros will not work at the same time. If Y_OPTIMIZE_4_SPEED is not defined, Y_OPTIMIZE_4_SIZE will be automatically defined.

In the yasmine property sheet, the Y_OPTIMIZE_4_SPEED is defined by default.