Skip to content

Commit

Permalink
initialize each class EbmlId as a constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Dec 18, 2023
1 parent 7d65209 commit 4550e06
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,62 +55,62 @@ extern const EbmlSemanticContext Context_EbmlGlobal;
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, nullptr, global, nullptr); \

#define DEFINE_xxx_MASTER(x,id,idl,parent,name,global) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlMaster(Context_##x) {}

#define DEFINE_xxx_MASTER_CONS(x,id,idl,parent,name,global) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x);

#define DEFINE_xxx_MASTER_ORPHAN(x,id,idl,name,global) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, nullptr, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \

#define DEFINE_xxx_CLASS(x,id,idl,parent,name,global) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() {}

#define DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x);

#define DEFINE_xxx_UINTEGER_DEF(x,id,idl,parent,name,global,defval) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlUInteger(defval) {}

#define DEFINE_xxx_SINTEGER_DEF(x,id,idl,parent,name,global,defval) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlSInteger(defval) {}

#define DEFINE_xxx_STRING_DEF(x,id,idl,parent,name,global,defval) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlString(defval) {}

#define DEFINE_xxx_FLOAT_DEF(x,id,idl,parent,name,global,defval) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlFloat(defval) {}

#define DEFINE_xxx_CLASS_GLOBAL(x,id,idl,name,global) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_EbmlGlobal); \

#define DEFINE_xxx_CLASS_ORPHAN(x,id,idl,name,global) \
const EbmlId Id_##x (id, idl); \
constexpr EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, nullptr, global, nullptr); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \

Expand Down

0 comments on commit 4550e06

Please sign in to comment.