2 #ifndef __BSE_CXX_UTILS_H__
3 #define __BSE_CXX_UTILS_H__
18 typedef SfiChoice Choice;
20 typedef SfiBBlock BBlock;
21 typedef SfiFBlock FBlock;
24 typedef SfiProxy Proxy;
32 template<
class Data>
static void
38 template<
class Derived,
class Base>
47 template<
class Derived,
class Base>
56 template<
class Derived,
class Base>
void
57 assert_derived_from (
void)
65 explicit Exception (
const char *_where) : loc (_where) {};
66 virtual const char* where() {
return loc; }
73 const char* what()
const throw() {
return g_intern_strconcat (
"invalid argument: ", item, NULL); }
75 #define InvalidArgument(WHAT) InvalidArgument2 (G_STRFUNC, #WHAT)
78 const char* what()
const throw() {
return "GValue contains wrong type for this kind of use"; }
82 const char* what()
const throw() {
return "Code section should not be reached"; }
86 const char* what()
const throw() {
return "Function to be connected has invalid signature"; }
95 virtual SfiRec* to_rec ();
101 #define BSE_CXX_TYPE_REGISTER(ObjectType, parent, class_info) \
102 BSE_CXX_TYPE_REGISTER_INITIALIZED (ObjectType, parent, class_info, NULL, TypeRegistry::NONE)
103 #define BSE_CXX_TYPE_REGISTER_ABSTRACT(ObjectType, parent, class_info) \
104 BSE_CXX_TYPE_REGISTER_INTERN (ObjectType, parent, class_info, NULL, NULL, TypeRegistry::ABSTRACT)
109 const char *category;
118 this->category = category;
134 ABSTRACT = G_TYPE_FLAG_ABSTRACT
142 GInstanceInitFunc iinit,
154 template<
class C>
const GType
155 bse_type_id_wrapper (
const char *type_name)
157 static GType type = 0;
160 type = g_type_from_name (type_name);
166 #define BSE_CXX_TYPE_GET_REGISTERED(NameSpace, ObjectType) \
167 (::Bse::bse_type_id_wrapper<ObjectType> (#NameSpace #ObjectType))
168 #define BSE_CXX_TYPE_REGISTER_INITIALIZED(ObjectType, parent, cinfo, binit, flags) \
169 BSE_CXX_TYPE_REGISTER_INTERN (ObjectType, parent, cinfo, binit, \
170 ::Bse::cxx_instance_init_trampoline<ObjectType>, flags)
171 #define BSE_CXX_TYPE_REGISTER_INTERN(ObjectType, parent, cinfo, binit, iinit, flags) \
172 static Bse::TypeRegistry \
173 ObjectType ## _type_keeper (sizeof (ObjectType), "Bse" #ObjectType, parent, \
175 ::Bse::cxx_class_init_trampoline<ObjectType>, \
177 #define BSE_CXX_UTILS_ALIGNMENT (2 * sizeof (gsize))
178 #define BSE_CXX_UTILS_ALIGN(offset) ((offset + BSE_CXX_UTILS_ALIGNMENT - 1) & -BSE_CXX_UTILS_ALIGNMENT)
179 #define BSE_CXX_SIZEOF(Class) BSE_CXX_UTILS_ALIGN (sizeof (Class))
180 #define BSE_CXX_COMMON_CLASS_SIZE sizeof (CxxBaseClass)
Definition: bsecxxutils.hh:70
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:67
Definition: bsecxxutils.hh:128
Definition: bsecxxutils.hh:90
Definition: bsecxxutils.hh:80
Definition: bsecxxutils.hh:64
Definition: bsecxxutils.hh:84
Definition: bsecxxutils.hh:76
Definition: bsecxxutils.hh:107
Definition: bsecxxutils.hh:39
Definition: bsecxxbase.hh:14