meta: add c++ wrapper of core module
This commit is contained in:
40
core-mm/include/blue/core/object.hpp
Normal file
40
core-mm/include/blue/core/object.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef BLUE_CORE_OBJECT_HPP_
|
||||
#define BLUE_CORE_OBJECT_HPP_
|
||||
|
||||
#include <blue/core/object.h>
|
||||
|
||||
namespace blue::core
|
||||
{
|
||||
class type;
|
||||
class object
|
||||
{
|
||||
public:
|
||||
static const size_t MAGIC = B_OBJECT_MAGIC;
|
||||
object(object &) = delete;
|
||||
object(object &&);
|
||||
|
||||
~object();
|
||||
|
||||
bool operator!()
|
||||
{
|
||||
return ptr_ == nullptr;
|
||||
}
|
||||
|
||||
void to_string(void) const;
|
||||
bool is_type(const type &type) const;
|
||||
b_object *ptr(void)
|
||||
{
|
||||
return ptr_;
|
||||
}
|
||||
const b_object *ptr(void) const
|
||||
{
|
||||
return ptr_;
|
||||
}
|
||||
|
||||
protected:
|
||||
object() = default;
|
||||
b_object *ptr_ = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user