1 /* Copyright (c) 1997-2021
2 Ewgenij Gawrilow, Michael Joswig, and the polymake team
3 Technische Universität Berlin, Germany
4 https://polymake.org
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version: http://www.gnu.org/licenses/gpl.txt.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 --------------------------------------------------------------------------------
16 */
17
18 #pragma once
19
20 #include "polymake/perl/constants.h"
21 #include "polymake/perl/Value.h"
22 #include "polymake/perl/types.h"
23 #include "polymake/perl/macros.h"
24 #include "polymake/perl/wrappers.h"
25 #include "polymake/perl/calls.h"
26 #include "polymake/perl/BigObject.h"
27
28 namespace polymake { namespace perl {
29
30 using pm::perl::Value;
31 using pm::perl::Scalar;
32 using pm::perl::Array;
33 using pm::perl::Hash;
34 using pm::perl::Canned;
35 using pm::perl::TryCanned;
36 using pm::perl::Enum;
37 using pm::perl::Returns;
38 using pm::perl::CrossApp;
39 using pm::perl::AnchorArg;
40 using pm::perl::load_data;
41 using pm::perl::save_data;
42 using pm::perl::get_custom;
43
44 extern std::ostream cout;
45 }
46
47 using pm::perl::BigObject;
48 using pm::perl::BigObjectType;
49 using pm::perl::ListReturn;
50 using pm::perl::OptionSet;
51 using pm::perl::Undefined;
52 using pm::perl::get_debug_level;
53
54 constexpr auto temporary = pm::perl::property_kind::temporary;
55
56 }
57
58 #ifdef POLYMAKE_APPNAME
59
60 namespace polymake { namespace POLYMAKE_APPNAME {
61
62 # ifdef POLYMAKE_BUNDLED_EXT
63 namespace bundled { namespace POLYMAKE_BUNDLED_EXT {
64 # endif
65
66 class GlueRegistratorTag;
67
68 # ifdef POLYMAKE_BUNDLED_EXT
69 } }
70
71 using PolymakeGlueRegistratorTag = bundled::POLYMAKE_BUNDLED_EXT::GlueRegistratorTag;
72
73 # define EmbeddedItemsKey4perl(app, bundled) MacroTokenAsString(app) ":" MacroTokenAsString(bundled)
74 # else
75
76 using PolymakeGlueRegistratorTag = GlueRegistratorTag;
77
78 # define EmbeddedItemsKey4perl(app, bundled) MacroTokenAsString(app)
79 # endif
80
81 template <typename Tag, pm::perl::RegistratorQueue::Kind kind>
get_registrator_queue(mlist<Tag>,std::integral_constant<pm::perl::RegistratorQueue::Kind,kind>)82 const pm::perl::RegistratorQueue& get_registrator_queue(mlist<Tag>, std::integral_constant<pm::perl::RegistratorQueue::Kind, kind>)
83 {
84 static pm::perl::RegistratorQueue queue(EmbeddedItemsKey4perl(POLYMAKE_APPNAME, POLYMAKE_BUNDLED_EXT), kind);
85 return queue;
86 }
87
88 namespace {
89
90 template <typename What, int id>
91 class QueueingRegistrator4perl {
92 public:
93 template <typename... Args>
QueueingRegistrator4perl(Args &&...args)94 explicit QueueingRegistrator4perl(Args&&... args)
95 {
96 static_cast<const What&>(get_registrator_queue(mlist<PolymakeGlueRegistratorTag>(), std::integral_constant<pm::perl::RegistratorQueue::Kind, What::kind>()))
97 .add__me(std::forward<Args>(args)...);
98 }
99
100 static QueueingRegistrator4perl r;
101 };
102
103 template <typename What, int id>
104 class StaticRegistrator4perl {
105 public:
106 template <typename... Args>
StaticRegistrator4perl(Args &&...args)107 explicit StaticRegistrator4perl(Args&&... args)
108 {
109 What::add__me(std::forward<Args>(args)...);
110 }
111
112 static StaticRegistrator4perl r;
113 };
114
115 } } }
116 #endif // POLYMAKE_APPNAME
117
118 namespace polymake { namespace perl_bindings {
119 ///==== Automatically generated contents follow. Please do not delete this line. ====
120 template <typename T, typename T0>
121 RecognizeType4perl("Polymake::common::Serialized", (T0), pm::Serialized<T0>)
122
123 template <typename T, typename T0, typename T1>
124 RecognizeType4perl("Polymake::common::Pair", (T0,T1), std::pair<T0,T1>)
125
126 template <typename T, typename T0, typename... T1>
127 RecognizeType4perl("Polymake::common::CachedObjectPointer", (T1...), const CachedObjectPointer<T0,T1...>)
128
129 ///==== Automatically generated contents end here. Please do not delete this line. ====
130 } }
131
132
133 // Local Variables:
134 // mode:C++
135 // c-basic-offset:3
136 // indent-tabs-mode:nil
137 // End:
138