Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
objclassid.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007-2025 Global Graphics Software Ltd. All rights reserved.
3 */
4
12
13#ifndef EDLOBJECTCLASSID_H
14#define EDLOBJECTCLASSID_H
15
16#include "edltypes.h"
17#include "edlstring.h"
18#include "memutils.h"
19
21
27
29{
30public:
31 union Data
32 {
34 uint8 b[16];
40
45 {
46 m_ID.dw[0]=0;
47 m_ID.dw[1]=0;
48 m_ID.dw[2]=0;
49 m_ID.dw[3]=0;
50 }
51
57 {
58 for( int i = 0; i < 16; i++ )
59 {
60 m_ID.b[i] = sxtob( str[i*2] ) * 16;
61 m_ID.b[i] += sxtob( str[i*2+1] );
62 }
63 }
64
69 CClassID(const CClassID & other)
70 {
71 EDLmemcpy(&m_ID, &other.m_ID, sizeof(m_ID));
72 }
73
78 void operator =(const CClassID & other)
79 {
80 if (this != &other)
81 {
82 EDLmemcpy(&m_ID, &other.m_ID, sizeof(m_ID));
83 }
84 }
85
86
94 CClassID( uint32 dw0, uint32 dw1, uint32 dw2, uint32 dw3)
95 {
96 m_ID.dw[0]=dw0;
97 m_ID.dw[1]=dw1;
98 m_ID.dw[2]=dw2;
99 m_ID.dw[3]=dw3;
100 }
101
107 bool equal( const CClassID &id ) const
108 {
109 if((m_ID.dw[0]==id.m_ID.dw[0]) &&
110 (m_ID.dw[1]==id.m_ID.dw[1]) &&
111 (m_ID.dw[2]==id.m_ID.dw[2]) &&
112 (m_ID.dw[3]==id.m_ID.dw[3]))
113 return true;
114 return false;
115 }
116};
117
124inline bool equal( const CClassID& id1, const CClassID& id2 )
125{
126 return id1.equal( id2 );
127}
128
134inline uint32 hashValue( const CClassID& id )
135{
136 return id.m_ID.hv;
137}
138
139#define DECLARE_CLASS_ID(class_id) \
140 static const CClassID &classID() \
141 { \
142 static CClassID id(class_id); \
143 return id; \
144 }
145
146#define IMPLEMENT_CLASS_ID(Type) \
147 const CClassID &getClassID() const override \
148 { \
149 return Type::classID(); \
150 }
151
153
154#endif /* EDLOBJECTCLASSID_H */
155
An object to represent a 128-bit globally unique ID.
Definition objclassid.h:29
union CClassID::Data m_ID
CClassID()
Constructor.
Definition objclassid.h:44
CClassID(const CClassID &other)
Copy to another CClassID.
Definition objclassid.h:69
void operator=(const CClassID &other)
operator =
Definition objclassid.h:78
bool equal(const CClassID &id) const
Compare to another CClassID.
Definition objclassid.h:107
CClassID(uint32 dw0, uint32 dw1, uint32 dw2, uint32 dw3)
Construct CClassID from 4 x uint32.
Definition objclassid.h:94
CClassID(const EDLSysString &str)
Converts hexadecimal representation of a CClassID to a CClassID.
Definition objclassid.h:56
#define _BEGIN_EDL_NAMESPACE
Definition edlnamespaces.h:75
#define _END_EDL_NAMESPACE
Definition edlnamespaces.h:76
EDLString and EDLSysString classes and associated EDL string manipulation functions.
std::string EDLSysString
Definition edlstring.h:158
uint8 sxtob(char c)
sxtob converts a hexadecimal character into corresponding (unsigned) integer value.
Definition edlstring.h:191
EDL "standard" types including known bit-length signed and unsigned integer type[def]s and definition...
unsigned int uint32
Definition edltypes.h:34
unsigned char uint8
Definition edltypes.h:32
EDL portability wrappers around memset(), memcpy() and memcmp() to allow EDL to use alternate impleme...
#define EDLmemcpy(dest, src, size)
Definition memutils.h:21
uint32 hashValue(const CClassID &id)
Obtain hash value for given CClassID.
Definition objclassid.h:134
bool equal(const CClassID &id1, const CClassID &id2)
Compare two CClassID (for the hashtable)
Definition objclassid.h:124
Definition objclassid.h:32
uint32 dw[4]
double word presentation - for copying, comparing
Definition objclassid.h:38
uint32 hv
hashvalue
Definition objclassid.h:36
uint8 b[16]
bytes presentation - for converting
Definition objclassid.h:34