41 lines
553 B
C++
41 lines
553 B
C++
|
|
#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
|