-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 #404 from liangzai12/main
simple function reflection
- Loading branch information
Showing
17 changed files
with
374 additions
and
28 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
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
19 changes: 19 additions & 0 deletions
19
engine/source/meta_parser/parser/language_types/method.cpp
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,19 @@ | ||
#include "common/precompiled.h" | ||
|
||
#include "class.h" | ||
#include "method.h" | ||
|
||
Method::Method(const Cursor& cursor, const Namespace& current_namespace, Class* parent) : | ||
TypeInfo(cursor, current_namespace), m_parent(parent), m_name(cursor.getSpelling()) | ||
{} | ||
|
||
bool Method::shouldCompile(void) const { return isAccessible(); } | ||
|
||
bool Method::isAccessible(void) const | ||
{ | ||
return ((m_parent->m_meta_data.getFlag(NativeProperty::Methods) || | ||
m_parent->m_meta_data.getFlag(NativeProperty::All)) && | ||
!m_meta_data.getFlag(NativeProperty::Disable)) || | ||
(m_parent->m_meta_data.getFlag(NativeProperty::WhiteListMethods) && | ||
m_meta_data.getFlag(NativeProperty::Enable)); | ||
} |
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,24 @@ | ||
#pragma once | ||
|
||
#include "type_info.h" | ||
|
||
class Class; | ||
|
||
class Method : public TypeInfo | ||
{ | ||
|
||
public: | ||
Method(const Cursor& cursor, const Namespace& current_namespace, Class* parent = nullptr); | ||
|
||
virtual ~Method(void) {} | ||
|
||
bool shouldCompile(void) const; | ||
|
||
public: | ||
|
||
Class* m_parent; | ||
|
||
std::string m_name; | ||
|
||
bool isAccessible(void) const; | ||
}; |
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
Oops, something went wrong.