37 #ifndef H_OGF_BASIC_ERTTI_SERIALIZER_H
38 #define H_OGF_BASIC_ERTTI_SERIALIZER_H
49 #ifdef GEO_COMPILER_CLANG
50 #pragma GCC diagnostic push
51 #pragma GCC diagnostic ignored "-Wcast-align"
67 object_size_(object_size), is_pod_(is_pod) {
254 T* array = (T*)address;
266 T* lhs_array = (T*)lhs;
267 T* rhs_array = (T*)rhs;
269 new(&lhs_array[i])T(rhs_array[i]);
277 T* array = (T*)address;
290 T* lhs_array = (T*)lhs;
291 T* rhs_array = (T*)rhs;
293 lhs_array[i] = rhs_array[i];
329 delete[]((T*)address);
336 #ifdef GEO_COMPILER_CLANG
337 #pragma GCC diagnostic pop
Base class for reference-counted objects.
Concrete implementation of LifeCycle.
Memory::pointer new_object(Memory::pointer rhs) override
Dynamically allocates a new object.
void assign_array(Memory::pointer lhs, Memory::pointer rhs, index_t nb) override
Copies an array of object at a given address.
void copy_construct(Memory::pointer lhs, Memory::pointer rhs) override
Copy-Constructs an object at a given address.
Memory::pointer new_object() override
Dynamically allocates a new object.
void delete_object(Memory::pointer address) override
Deletes an object.
void destroy_array(Memory::pointer address, index_t nb) override
Destroys an array of object at a given address.
Memory::pointer new_array(index_t nb) override
Dynamically allocates an array of objects.
GenericLifeCycle()
GenericLifeCycle constructor.
void copy_construct_array(Memory::pointer lhs, Memory::pointer rhs, index_t nb) override
Copy-Constructs an array of object at a given address.
void construct_array(Memory::pointer address, index_t nb) override
Calls the constructor of objects in an array.
void destroy(Memory::pointer address) override
Calls the destructor of an object.
void delete_array(Memory::pointer address) override
Deletes an array of objects.
void assign(Memory::pointer lhs, Memory::pointer rhs) override
Calls the assignment operator.
void construct(Memory::pointer address) override
Calls the constructor of an object.
Manages the life cycle of an object.
bool is_pod() const
Tests whether object is pod (plain ordinary datatype).
virtual void destroy(Memory::pointer address)=0
Calls the destructor of an object.
virtual void construct(Memory::pointer address)=0
Calls the constructor of an object.
virtual void construct_array(Memory::pointer address, index_t nb)=0
Calls the constructor of objects in an array.
virtual void destroy_array(Memory::pointer address, index_t nb)=0
Destroys an array of object at a given address.
virtual Memory::pointer new_object(Memory::pointer rhs)=0
Dynamically allocates a new object with copy constructor.
virtual void assign_array(Memory::pointer lhs, Memory::pointer rhs, index_t nb)=0
Copies an array of object at a given address.
virtual Memory::pointer new_object()=0
Dynamically allocates a new object.
virtual void delete_object(Memory::pointer address)=0
Deletes an object.
virtual void copy_construct(Memory::pointer lhs, Memory::pointer rhs)=0
Copy-Constructs an object at a given address.
virtual void delete_array(Memory::pointer address)=0
Deletes an array of objects.
size_t object_size() const
Gets the size of an object.
virtual void assign(Memory::pointer lhs, Memory::pointer rhs)=0
Calls the assignment operator.
virtual void copy_construct_array(Memory::pointer lhs, Memory::pointer rhs, index_t nb)=0
Copy-Constructs an array of object at a given address.
LifeCycle(size_t object_size, bool is_pod=false)
LifeCycle constructor.
virtual ~LifeCycle()
LifeCycle destructor.
virtual Memory::pointer new_array(index_t nb)=0
Dynamically allocates an array of objects.
Base class of reference-counted objects, to be used with smart pointers.
Types and functions for memory manipulation.
byte * pointer
Pointer to unsigned byte(s)
void geo_argused(const T &)
Suppresses compiler warnings about unused parameters.
geo_index_t index_t
The type for storing and manipulating indices.
Global Graphite namespace.
SmartPointer< LifeCycle > LifeCycle_var
A reference_counted pointer to a LifeCycle.
Definitions common to all include files in the gom library.