Plutonium framework API 0.3.0
UI framework libraries for libnx
Loading...
Searching...
No Matches
pu_Include.hpp
Go to the documentation of this file.
1
2/*
3
4 Plutonium library
5
6 @file pu_Include.hpp
7 @brief Basic includes and definitions for the library
8
9 @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
10
11*/
12
13#pragma once
14#include <switch.h>
15#include <string>
16#include <memory>
17#include <cmath>
18
19// Defines a static function (::New(...)) as a constructor for smart ptrs, also defines a custom type (::Ref) to simplify it
20#define PU_SMART_CTOR(type) using
21 Ref = std::shared_ptr<type>; template
22 <typename ...Args> inline
23 static Ref New(Args &&...ctor_args) {
24 return std::make_shared<type>(std::forward<Args>(ctor_args)...); \
25}
26
27#define PU_CLASS_POD_GET(fn_name, var_name, type) inline
28 type Get##fn_name() {
29 return this->var_name; \
30}
31
32#define PU_CLASS_POD_SET(fn_name, var_name, type) inline
33 void Set##fn_name(const type new_val) {
34 this->var_name = new_val; \
35}
36
37#define PU_CLASS_POD_GETSET(fn_name, var_name, type) PU_CLASS_POD_GET
38 (fn_name, var_name, type) PU_CLASS_POD_SET
39 (fn_name, var_name, type)
40
41namespace pu {
42
43 using i32 = s32;
44
45}