-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from iboB/dev
- Loading branch information
Showing
28 changed files
with
486 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Borislav Stanimirov | ||
// SPDX-License-Identifier: MIT | ||
// | ||
#pragma once | ||
#include "bits/sv.h" | ||
#include "bits/noexcept.h" | ||
#include "type_handle.h" | ||
|
||
typedef bool (*dnmx_type_class_match_func)(dnmx_type_handle) DNMX_NOEXCEPT; | ||
|
||
typedef struct dnmx_type_class { | ||
// may be left empty, but in such a case the type class cannot be registered in a domain | ||
dnmx_sv name; | ||
|
||
// this must not be left null: it's always assumed to not be null | ||
dnmx_type_class_match_func matches; | ||
} dnmx_type_class; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) Borislav Stanimirov | ||
// SPDX-License-Identifier: MIT | ||
// | ||
#pragma once | ||
#include "../dnmx/bits/pp.h" | ||
#include "type_class.hpp" | ||
|
||
#define DYNAMIX_DECLARE_EXPORTED_TYPE_CLASS(export, tc) struct export tc { static const dynamix::type_class m_dynamix_type_class; } | ||
#define DYNAMIX_DECLARE_TYPE_CLASS(tc) DYNAMIX_DECLARE_EXPORTED_TYPE_CLASS(I_DNMX_PP_EMPTY(), tc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Borislav Stanimirov | ||
// SPDX-License-Identifier: MIT | ||
// | ||
#pragma once | ||
#include "declare_type_class.hpp" | ||
#include "globals.hpp" | ||
#include "domain.hpp" | ||
#include "type.hpp" | ||
|
||
namespace dynamix::impl { | ||
struct registered_type_class_instance { | ||
domain& dom; | ||
const type_class& tc; | ||
registered_type_class_instance(domain& dom, const type_class& tc) : dom(dom), tc(tc) { | ||
dom.register_type_class(tc); | ||
} | ||
~registered_type_class_instance() { | ||
dom.unregister_type_class(tc); | ||
} | ||
}; | ||
} | ||
|
||
// define a type class with bool(const type&); | ||
#define DYNAMIX_DEFINE_TYPE_CLASS_WITH(domain_tag, tc, func) \ | ||
const dynamix::type_class tc::m_dynamix_type_class = {dnmx_make_sv_lit(#tc), func}; \ | ||
static ::dynamix::impl::registered_type_class_instance I_DNMX_PP_CAT(_dynamix_type_class_, tc)(::dynamix::g::get_domain<domain_tag>(), tc::m_dynamix_type_class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.