#include "config.h"
#include <assert.h>
#include <map>
#include <string>
#include "plpintl.h"
Go to the source code of this file.
◆ ENUM_DEFINITION_BEGIN
| #define ENUM_DEFINITION_BEGIN |
( |
|
EnumName, |
|
|
|
initWith |
|
) |
| |
Value: \
name(#EnumName),defaultValue(initWith) {
sdata()
The constructor of the static data part.
Helper macro to construct an enumeration wrapper Enum<E> for a specific enum type.
It defines the static variable holding the static information and provides the head of its Constructor. You only have to provide the string-mapping additions in the constructor body. This macro behaves much like a function declaration, i.e. you have to start the constructor with { ..
usage example:
// declaration of enumeration; somewhere
class rfsv {
[...]
enum PSI_ERROR_CODES { E_PSI_GEN_NONE, E_PSI_GEN_FAIL, E_PSI_GEN_ARG };
[...]
};
// definition of the Enum<E> with the appropriate string representations
ENUM_DEFINITION_BEGIN(rfsv::PSI_ERROR_CODES, rfsv::E_PSI_GEN_NONE)
stringRep.add(rfsv::E_PSI_GEN_NONE, "no error");
stringRep.add(rfsv::E_PSI_GEN_FAIL, "general");
stringRep.add(rfsv::E_PSI_GEN_ARG, "bad argument");
ENUM_DEFINITION_END(rfsv::PSI_ERROR_CODES)
- Parameters
-
| EnumName | The fully qualified Name of the enum type to be wrapped |
| initWith | The fully qualified Name of the initialization value. |
- Author
- Henner Zeller The definition of the static variable holding the static data for this Enumeration wrapper.
Definition at line 299 of file Enum.h.
◆ ENUM_DEFINITION_END
| #define ENUM_DEFINITION_END |
( |
|
EnumName | ) |
} template Enum< EnumName >::sdata Enum< EnumName >::staticData; |
◆ operator<<()
Writes enumeration's string representation.
Definition at line 311 of file Enum.h.