22#if !defined(OPENNURBS_OBJECT_INC_)
23#define OPENNURBS_OBJECT_INC_
56 const char* sClassName,
57 const char* sBaseClassName,
63 const char* sClassName,
64 const char* sBaseClassName,
81 const char* sClassName
104 static int IncrementMark();
105 static int CurrentMark();
130 static int Purge(
int mark);
131 static bool PurgeAfter(
const ON_ClassId* pClassId);
143 const char* ClassName()
const;
147 const char* BaseClassName()
const;
185 unsigned int ClassIdVersion()
const;
193 char m_sClassName[80];
194 char m_sBaseClassName[80];
205 void ConstructorHelper(
206 const char* sClassName,
207 const char* sBaseClassName,
234#define ON_CLASS_ID( cls ) ON_ClassId::ClassId( #cls )
294#define ON_OBJECT_DECLARE( cls ) \
296 static void* m_s_##cls##_ptr; \
298 static const ON_ClassId m_##cls##_class_id; \
301 static cls * Cast( ON_Object* ); \
305 static const cls * Cast( const ON_Object* ); \
309 virtual const ON_ClassId* ClassId() const; \
313 virtual ON_Object* DuplicateObject() const; \
316 static bool Copy##cls( const ON_Object*, ON_Object* ); \
322 cls * Duplicate() const; \
334#define ON_VIRTUAL_OBJECT_IMPLEMENT( cls, basecls, uuid ) \
335 void* cls::m_s_##cls##_ptr = 0;\
336 const ON_ClassId cls::m_##cls##_class_id(#cls,#basecls,0,0,uuid);\
337 cls * cls::Cast( ON_Object* p) {return(cls *)Cast((const ON_Object*)p);} \
338 const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_id))?(const cls *)p:0;} \
339 const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_id;} \
340 ON_Object* cls::DuplicateObject() const {return 0;} \
341 bool cls::Copy##cls( const ON_Object*, ON_Object* ) {return false;} \
342 cls * cls::Duplicate() const {return static_cast<cls *>(DuplicateObject());}
349#define ON_OBJECT_IMPLEMENT( cls, basecls, uuid ) \
350 void* cls::m_s_##cls##_ptr = 0;\
351 static ON_Object* CreateNew##cls() {return new cls();} \
352 const ON_ClassId cls::m_##cls##_class_id(#cls,#basecls,CreateNew##cls,cls::Copy##cls,uuid);\
353 cls * cls::Cast( ON_Object* p) {return(cls *)Cast((const ON_Object*)p);} \
354 const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_id))?(const cls *)p:0;} \
355 const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_id;} \
356 ON_Object* cls::DuplicateObject() const {cls* p = new cls(); if (p) *p=*this; return p;} \
357 bool cls::Copy##cls( const ON_Object* src, ON_Object* dst ){cls* d;const cls* s;if (0!=(s=cls::Cast(src))&&0!=(d=cls::Cast(dst))) {d->cls::operator=(*s);return true;}return false;} \
358 cls * cls::Duplicate() const {return static_cast<cls *>(DuplicateObject());}
360#define ON__SET__THIS__PTR(ptr) if (ptr) *((void**)this) = ptr
377#if defined(ON_DLL_TEMPLATE)
381#pragma warning( push )
382#pragma warning( disable : 4231 )
384#pragma warning( pop )
429#if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
433 void*
operator new(size_t);
434 void operator delete(
void*);
437 void*
operator new[] (size_t);
438 void operator delete[] (
void*);
441 void*
operator new(size_t,
void*);
442 void operator delete(
void*,
void*);
466 void MemoryRelocate();
539 unsigned int SizeOf()
const;
625 ON::object_type ObjectType()
const;
663 const wchar_t* string_value
702 int GetUserStringKeys(
769 void PurgeUserData();
791 void TransformUserData(
844 void DestroyRuntimeCache(
bool bDelete =
true );
Definition opennurbs_archive.h:152
int ReadObject(ON_Object **ppObject)
Definition opennurbs_archive.cpp:3117
bool WriteObject(const ON_Object *)
Definition opennurbs_archive.cpp:2778
bool ReadObjectUserData(ON_Object &object)
Definition opennurbs_archive.cpp:3558
bool WriteObjectUserData(const ON_Object &object)
Definition opennurbs_archive.cpp:2938
Definition opennurbs_array.h:760
Definition opennurbs_object.h:42
static ON_ClassId * m_p0
Definition opennurbs_object.h:188
void * m_f6
Definition opennurbs_object.h:221
static int m_mark0
Definition opennurbs_object.h:190
void * m_f5
Definition opennurbs_object.h:220
ON_ClassId & operator=(const ON_ClassId &)
static ON_ClassId * m_p1
Definition opennurbs_object.h:189
const ON_ClassId * m_pBaseClassId
Definition opennurbs_object.h:192
ON_UUID m_uuid
Definition opennurbs_object.h:196
int m_mark
Definition opennurbs_object.h:197
ON_ClassId * m_pNext
Definition opennurbs_object.h:191
ON_ClassId(const ON_ClassId &)
void * m_f3
Definition opennurbs_object.h:218
void * m_f4
Definition opennurbs_object.h:219
void * m_f7
Definition opennurbs_object.h:222
void * m_f2
Definition opennurbs_object.h:217
unsigned int m_class_id_version
Definition opennurbs_object.h:215
void * m_f8
Definition opennurbs_object.h:223
Definition opennurbs_object.h:393
virtual ON_BOOL32 IsValid(ON_TextLog *text_log=NULL) const =0
ON_OBJECT_DECLARE(ON_Object)
ON_MEMORY_POOL * m_mempool
Definition opennurbs_object.h:846
ON_UserData * m_userdata_list
Definition opennurbs_object.h:853
friend class ON_UserData
Definition opennurbs_object.h:852
Definition opennurbs_textlog.h:20
Definition opennurbs_uuid.h:31
Definition opennurbs_userdata.h:20
Definition opennurbs_object.h:365
ON_wString m_string_value
Definition opennurbs_object.h:370
ON_wString m_key
Definition opennurbs_object.h:369
Definition opennurbs_string.h:392
#define ON_DECL
Definition opennurbs_defines.h:92
#define ON_CLASS
Definition opennurbs_defines.h:91
ON_DECL struct ON_Vtable * ON_ClassVtable(void *p)
Definition opennurbs_object.cpp:1876
ON_DECL ON_UUID ON_GetMostRecentClassIdCreateUuid()
Definition opennurbs_object.cpp:932
int(* ON_Vtable_func)(void)
Definition opennurbs_object.h:250
#define NULL
Definition opennurbs_system.h:256
int ON_BOOL32
Definition opennurbs_system.h:362
unsigned int ON__UINT32
Definition opennurbs_system.h:326
Definition opennurbs_object.h:253
ON_Vtable_func f[4]
Definition opennurbs_object.h:260
Definition opennurbs_memory.h:207