welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
module.hpp File Reference

Full-automation entry point for the opaque-container generator rod: the WELDER_OPAQUE_CONTAINERS_MAIN generator-main() macro. More...

#include <fstream>
#include <iostream>
#include <welder/rods/python/opaque_containers/rod.hpp>
Include dependency graph for module.hpp:

Go to the source code of this file.

Macros

#define WELDER_OPAQUE_CONTAINERS_MAIN_STYLED(ns, style)
 Like WELDER_OPAQUE_CONTAINERS_MAIN, but with a custom name style — a welder::naming style that may carry a transform_opaque_container hook to name the opaque wrappers (see document.hpp / the Containers guide).
#define WELDER_OPAQUE_CONTAINERS_MAIN(ns)
 Define a main() that emits the opaque-container header for namespace ns.

Detailed Description

Full-automation entry point for the opaque-container generator rod: the WELDER_OPAQUE_CONTAINERS_MAIN generator-main() macro.

Include this (instead of rod.hpp) in a generator TU so the whole executable is one macro line; welder_generate_opaque_containers() (CMake) builds and runs it into <name>.opaque.hpp.

Definition in file module.hpp.

Macro Definition Documentation

◆ WELDER_OPAQUE_CONTAINERS_MAIN

#define WELDER_OPAQUE_CONTAINERS_MAIN ( ns)
Value:
#define WELDER_OPAQUE_CONTAINERS_MAIN_STYLED(ns, style)
Like WELDER_OPAQUE_CONTAINERS_MAIN, but with a custom name style — a welder::naming style that may ca...
Definition module.hpp:23
The identity style: bind every C++ identifier unchanged.
Definition naming.hpp:259

Define a main() that emits the opaque-container header for namespace ns.

Writes to the file named by the first command-line argument, or to stdout when none is given — the build-time analogue of a backend entry point: welder_generate_opaque_containers runs the generator with the output path. Uses the default (collision-free derived) names; for custom naming use WELDER_OPAQUE_CONTAINERS_MAIN_STYLED.

Parameters
nsthe top-level namespace / module name token.

Definition at line 43 of file module.hpp.

◆ WELDER_OPAQUE_CONTAINERS_MAIN_STYLED

#define WELDER_OPAQUE_CONTAINERS_MAIN_STYLED ( ns,
style )
Value:
int main(int argc, char** argv) { \
if (argc > 1) { \
::std::ofstream welder_out_{argv[1]}; \
::welder::rods::opaque_containers::rod::generate<^^ns, style>(welder_out_); \
} else { \
::welder::rods::opaque_containers::rod::generate<^^ns, style>(::std::cout); \
} \
return 0; \
}

Like WELDER_OPAQUE_CONTAINERS_MAIN, but with a custom name style — a welder::naming style that may carry a transform_opaque_container hook to name the opaque wrappers (see document.hpp / the Containers guide).

The default macro passes welder::naming::none (the collision-free derived names).

Parameters
nsthe top-level namespace / module name token.
stylea name-style type (its transform_opaque_container, if any, names the wrappers).

Definition at line 23 of file module.hpp.