Loading...
Searching...
No Matches
jsclassregistrar.h File Reference
`#include <functional>`
`#include <unordered_map>`
`#include <QMap>`
`#include <QJSEngine>`
`#include "pappsomspp/export-import-config.h"`

Go to the source code of this file.

## Classes

struct | pappso::NamespaceClassnameAsKeyHash
struct | pappso::AreNamespaceClassnamePairsEqual

## Namespaces

namespace | pappso
| tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multicharge peaks to monocharge

## Macros

#define | STRINGIFY_NS(ns)
#define | PAPPSO_REGISTER_JS_CLASS(NS_IDENT, CLASS_NAME)

## Typedefs

using | pappso::NamespaceClassnamePairAsKey = std::pair<QString, QString>
using | pappso::RegisterFunc = std::function<void(QJSEngine *)>

## Functions

std::unordered_map< NamespaceClassnamePairAsKey, RegisterFunc, NamespaceClassnameAsKeyHash, AreNamespaceClassnamePairsEqual > & | pappso::getNameSpaceClassNameJsConstructorRegistrarMap ()
void | pappso::registerJsConstructorForNameSpaceClassNameInRegistrarMap (const QString &name_space, const QString &class_name, QJSEngine *engine)
void | pappso::registerJsConstructorForEachClassInRegistrarMap (QJSEngine *engine)

## Macro Definition Documentation

## PAPPSO_REGISTER_JS_CLASS

#define PAPPSO_REGISTER_JS_CLASS | ( |  | NS_IDENT,
|  |  | CLASS_NAME )

Value:
struct JsRegHelper_##CLASS_NAME \
{ \
JsRegHelper_##CLASS_NAME() \
{ \
pappso::getNameSpaceClassNameJsConstructorRegistrarMap().insert( \
{{QStringLiteral(STRINGIFY_NS(NS_IDENT)), QStringLiteral(#CLASS_NAME)}, \
[](QJSEngine *engine) { NS_IDENT::CLASS_NAME::registerJsConstructor(engine); }}); \
} \
}; \
static JsRegHelper_##CLASS_NAME jsRegHelperInstance_##CLASS_NAME;
STRINGIFY_NS
#define STRINGIFY_NS(ns)
Definition jsclassregistrar.h:34

Definition at line 35 of file jsclassregistrar.h.

#define PAPPSO_REGISTER_JS_CLASS(NS_IDENT, CLASS_NAME) \
struct JsRegHelper_##CLASS_NAME \
{ \
JsRegHelper_##CLASS_NAME() \
{ \
pappso::getNameSpaceClassNameJsConstructorRegistrarMap().insert( \
{{QStringLiteral(STRINGIFY_NS(NS_IDENT)), QStringLiteral(#CLASS_NAME)}, \
[](QJSEngine *engine) { NS_IDENT::CLASS_NAME::registerJsConstructor(engine); }}); \
} \
}; \
static JsRegHelper_##CLASS_NAME jsRegHelperInstance_##CLASS_NAME;

## STRINGIFY_NS

#define STRINGIFY_NS | ( |  | ns | ) |

Value:
#ns

Definition at line 34 of file jsclassregistrar.h.