KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Core.h File Reference

This file contains the macros for Karma's classes' general purpose use, including assertions and storage-class information (for multiplatforms). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define KARMA_API
 Defining Karma's API macro for storage class information.
 
#define BIT(x)
 Macro for bit-shift operation (left)
 
#define KR_ASSERT(expr, ...)
 Karma's Assertion.
 
#define KR_CORE_ASSERT(expr, ...)
 
#define KR_BIND_EVENT_FN(fn)
 Macro for std::bind routine. See https://en.cppreference.com/w/cpp/utility/functional/bind.
 
#define KR_NONCOPYABLE(TypeName)
 Makes a type non-copyable and non-movable by deleting copy/move constructors and assignment/move operators. The macro should be placed in the public section of the type for better compiler diagnostic messages. Example usage:
 
#define FUNCTION_NON_NULL_RETURN_START
 
#define FUNCTION_NON_NULL_RETURN_END
 
#define FORCEINLINE   inline
 Typical inlining macro for clarity.
 

Detailed Description

This file contains the macros for Karma's classes' general purpose use, including assertions and storage-class information (for multiplatforms).

Author
Ravi Mohan (the_cowboy)
Version
1.0
Date
November 27, 2020

Macro Definition Documentation

◆ BIT

#define BIT ( x)
Value:
(1 << x)

Macro for bit-shift operation (left)

Basically shifting 0000001 to x power of 2 (2^x). BIT(1) is 0000010

Since
Karma 1.0.0

◆ FORCEINLINE

#define FORCEINLINE   inline

Typical inlining macro for clarity.

Since
Karma 1.0.0

◆ KARMA_API

#define KARMA_API

Defining Karma's API macro for storage class information.

Note
This is platform based for dynamic linking (dll or shared object, or dylib)
Since
Karma 1.0.0

◆ KR_ASSERT

#define KR_ASSERT ( expr,
... )

Karma's Assertion.

Note
The KR_ENABLE_ASSERTS must be defined
Since
Karma 1.0.0

◆ KR_BIND_EVENT_FN

#define KR_BIND_EVENT_FN ( fn)
Value:
std::bind(&fn, this, std::placeholders::_1)

Macro for std::bind routine. See https://en.cppreference.com/w/cpp/utility/functional/bind.

Since
Karma 1.0.0

◆ KR_NONCOPYABLE

#define KR_NONCOPYABLE ( TypeName)
Value:
TypeName(TypeName&&) = delete; \
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete; \
TypeName& operator=(TypeName&&) = delete;

Makes a type non-copyable and non-movable by deleting copy/move constructors and assignment/move operators. The macro should be placed in the public section of the type for better compiler diagnostic messages. Example usage:

class FMyClassName
{
public:
UE_NONCOPYABLE(FMyClassName)
FMyClassName() = default;
};