PCL
MetaModule Utility Macros

Macros

#define PCL_MODULE_UNIQUE_ID(uid)    ("PIXINSIGHT_MODULE_UNIQUE_ID_" PCL_STRINGIFY( uid ))
 
#define PCL_MODULE_VERSION(MM, mm, rr, bbbb, lan)
 A utility macro to build a module version string. More...
 
#define PCL_MODULE_VERSION_S(MM, mm, rr, bbbb, lan, status)
 A utility macro to build a module version string, including a development status specification. More...
 

Detailed Description

Macro Definition Documentation

◆ PCL_MODULE_UNIQUE_ID

#define PCL_MODULE_UNIQUE_ID (   uid)     ("PIXINSIGHT_MODULE_UNIQUE_ID_" PCL_STRINGIFY( uid ))
Deprecated:
This macro has been deprecated. It is kept as part of PCL for compatibility with existing modules. Do not use it in newly produced code.

Definition at line 756 of file MetaModule.h.

◆ PCL_MODULE_VERSION

#define PCL_MODULE_VERSION (   MM,
  mm,
  rr,
  bbbb,
  lan 
)
Value:
("PIXINSIGHT_MODULE_VERSION_" \
PCL_STRINGIFY( MM ) "." \
PCL_STRINGIFY( mm ) "." \
PCL_STRINGIFY( rr ) "." \
PCL_STRINGIFY( bbbb ) "." \
PCL_STRINGIFY( lan ))
Parameters
MMThe main (major) version number of the module. Must be an integer in the range from 0 to 99, and must be left-padded with a zero, when necessary.
mmThe second (minor) version number of the module. Must be an integer in the range from 0 to 99, and must be left-padded with a zero, when necessary.
rrThe revision version number of the module. Must be an integer in the range from 0 to 99, and must be left-padded with a zero, when necessary.
bbbbThe build version number of the module. Must be an integer in the range from 1 to 9999, and must be left-padded with a maximum of three zeros, as necessary.
lanThe primary language of the module. Must be a valid ISO 639.2 language code (a 3-letter code identifying a language).

This macro generates a string literal with the mandatory "PIXINSIGHT_MODULE_VERSION_" prefix prepended to the actual module version string, which is composed by concatenation of the specified macro arguments.

Example:

#define MODULE_VERSION_MAJOR 01
#define MODULE_VERSION_MINOR 00
#define MODULE_VERSION_REVISION 02
#define MODULE_VERSION_BUILD 0045
#define MODULE_VERSION_LANGUAGE eng
...
#include <pcl/MetaModule.h>
...
class MyModule : public pcl::MetaModule
{
// Define your module class here
};
...
const char* MyModule::Version() const
{
return PCL_MODULE_VERSION( MODULE_VERSION_MAJOR,
MODULE_VERSION_MINOR,
MODULE_VERSION_REVISION,
MODULE_VERSION_BUILD,
MODULE_VERSION_LANGUAGE );
}
A formal description of a PixInsight module.
Definition: MetaModule.h:102
#define PCL_MODULE_VERSION(MM, mm, rr, bbbb, lan)
A utility macro to build a module version string.
Definition: MetaModule.h:820
PCL root namespace.
Definition: AbstractImage.h:77

In the example above, the Version() member of MyModule would return the following version string:

"PIXINSIGHT_MODULE_VERSION_01.00.02.0045.eng"

See also
PCL_MODULE_VERSION_S, PCL_MODULE_UNIQUE_ID

Definition at line 820 of file MetaModule.h.

◆ PCL_MODULE_VERSION_S

#define PCL_MODULE_VERSION_S (   MM,
  mm,
  rr,
  bbbb,
  lan,
  status 
)
Value:
("PIXINSIGHT_MODULE_VERSION_" \
PCL_STRINGIFY( MM ) "." \
PCL_STRINGIFY( mm ) "." \
PCL_STRINGIFY( rr ) "." \
PCL_STRINGIFY( bbbb ) "." \
PCL_STRINGIFY( lan ) "." \
PCL_STRINGIFY( status ))

This macro is an extension of the PCL_MODULE_VERSION macro. It generates a version string that also includes a development status, specified as the status macro argument.

The status argument can have the following values:

alpha For an alpha development status

beta For a beta development status

release For a release (final) version

rc<n> For a release candidate version, where <n> is the release candidate number.

exp For an experimental version (usually a development version not intended for public release).

Other values are not recognized by the platform and cause rejection of a module for installation.

This macro generates a string that is suitable to be returned by a reimplementation of MetaModule::Version(). An example follows:

Example:

#define MODULE_VERSION_MAJOR 01
#define MODULE_VERSION_MINOR 00
#define MODULE_VERSION_REVISION 02
#define MODULE_VERSION_BUILD 0045
#define MODULE_VERSION_LANGUAGE eng
#define MODULE_VERSION_STATUS rc3
...
#include <pcl/MetaModule.h>
...
class MyModule : public pcl::MetaModule
{
// Define your module class here
};
...
const char* MyModule::Version() const
{
return PCL_MODULE_VERSION_S( MODULE_VERSION_MAJOR,
MODULE_VERSION_MINOR,
MODULE_VERSION_REVISION,
MODULE_VERSION_BUILD,
MODULE_VERSION_LANGUAGE,
MODULE_VERSION_STATUS );
}
#define PCL_MODULE_VERSION_S(MM, mm, rr, bbbb, lan, status)
A utility macro to build a module version string, including a development status specification.
Definition: MetaModule.h:893

In the example above, the Version() member of MyModule would return the following version string:

"PIXINSIGHT_MODULE_VERSION_01.00.02.0045.eng.rc3"

See also
PCL_MODULE_VERSION, PCL_MODULE_UNIQUE_ID

Definition at line 893 of file MetaModule.h.