This file contains hidden or 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
import asyncio | |
import logging | |
from datetime import datetime | |
from threading import RLock | |
import bluepy.btle | |
# uuid of the service that controls snooz | |
SNOOZ_SERVICE_UUID = "729f0608496a47fea1243a62aaa3fbc0" |
This file contains hidden or 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
__attribute__(( annotate( "Hey look at this annotation!" ) )) |
This file contains hidden or 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
#if defined(__REFLECTION_PARSER__) | |
# define Meta(...) __attribute__((annotate(#__VA_ARGS__))) | |
#else | |
# define Meta(...) | |
#endif |
This file contains hidden or 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
struct Mashed : public MetaProperty { }; | |
Meta(Mashed) | |
int potatoes; |
This file contains hidden or 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
int foo(int a, float b, double c) | |
{ | |
return 0; | |
} | |
auto fooWrapper = [](int a, float b, double c) | |
{ | |
return foo( a, b, c ); | |
}; |
This file contains hidden or 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
class DemoClass | |
{ | |
public: | |
int someMethod(int a) | |
{ | |
return a; | |
} | |
}; | |
auto someMethodWrapper = [](Variant &obj, ArgumentList &args) |
This file contains hidden or 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
struct SoundEffect | |
{ | |
float volume; | |
void Load(const std::string &filename); | |
}; | |
int main(void) | |
{ | |
Type soundEffectType = typeof( SoundEffect ); |
This file contains hidden or 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
enum class SliderType | |
{ | |
Horizontal, | |
Vertical | |
}; | |
struct Slider : public MetaProperty | |
{ | |
SliderType type; |
This file contains hidden or 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
struct SoundEffect | |
{ | |
Meta(Range(0.0f, 100.0f)) | |
float volume; | |
}; | |
int main(void) | |
{ | |
// you can also use type meta::Type::Get( "SoundEffect" ) based on a string name | |
Type soundEffectType = typeof( SoundEffect ); |
This file contains hidden or 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
set(PROJECT_NAME "Example") | |
# assume this contains header files for this project | |
set(PROJECT_HEADER_FILES ...) | |
# assume this contains source files for this project | |
set(PROJECT_SOURCE_FILES ...) | |
# generated file names, in the build directory | |
set(META_GENERATED_HEADER "${CMAKE_CURRENT_BINARY_DIR}/Meta.Generated.h") |
NewerOlder