Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
CElementMethods Class Referenceabstract

CElementMethods is provided to CElementArray and give some information on the data as well as the methods to construct or destruct data in-place. More...

Detailed Description

CElementMethods is provided to CElementArray and give some information on the data as well as the methods to construct or destruct data in-place.

#include <ElementArray.h>

Inheritance diagram for CElementMethods:
CInstanciatedObject CFacePropertyMethods CUVWPointMethods CVCPointMethods CWeightPointMethods

Public Member Functions

virtual bool IsObject () const
 
virtual bool IsKindOf (const CElementMethods *methods) const
 For class we if this->GetBaseType() == B->GetType() that means that this knows how to copy from B.
 
virtual SIZET GetSizeof () const =0
 
virtual ElementType GetType () const =0
 
virtual ElementType GetBaseType () const =0
 
virtual void ConstructElement (void *pNewData)=0
 
virtual void DestructElement (void *pNewData)
 
virtual void CopyElement (void *pDest, const void *pSrc)
 
virtual void CopyElement (void *pDest, const CElementMethods *pSrcMethods, const void *pSrc, const CElementMethods *pDstMethods)
 
virtual void SerializeElement (CXArchive &ar, void *pSrc)
 
virtual CXRuntimeClassPtr GetRuntimeClassDescriptor () const
 
- Public Member Functions inherited from CInstanciatedObject
virtual bool Delete ()
 
int GetRefCount () const
 
int AddRef () const
 

Member Function Documentation

◆ IsKindOf()

virtual bool CElementMethods::IsKindOf ( const CElementMethods methods) const
virtual

For class we if this->GetBaseType() == B->GetType() that means that this knows how to copy from B.

This is the default object comparison method use when we store raw memory structure If we compare this and B:

  • We have this->GetBaseType == B->GetType, we make a memcpy with the size of the structure
  • We have this->GetBaseType = B->GetType, we memcpy with the sizeof(A)
  • We have this->GetType = B->GetBaseType, we memcpy with the sizeof(B) @Note If we have this->GetBaseType == this->GetBaseType we cannot do anything even if the structure are in relation, because
    we don't know the sizeof the BaseType. In such case IsObject should return true and CopyElement can handle this
    kind copy

◆ IsObject()

virtual bool CElementMethods::IsObject ( ) const
virtual

Return false is element array are object that need to be destructed, copied or serialized
in this case, element are memory struct and array used memcpy
when true is returned, DestructElement/CopyElement/SerializeElement is called anytime it is needed
@Note for class should return true if the class has virtual method and if we make copy between inherited object
otherwise memcpy overwrite the virtual table, and the inheritance is lost


The documentation for this class was generated from the following file: