KVIrc 5.2.6
Developer APIs
KviKvsVariant.cpp File Reference
#include "KviKvsVariant.h"
#include "KviKvsArrayCast.h"
#include "KviKvsHash.h"
#include "KviKvsArray.h"
#include <cmath>
#include <cinttypes>

Macros

#define CMP_EQUAL   0
 
#define CMP_OTHERGREATER   1
 
#define CMP_THISGREATER   -1
 
#define DELETE_VARIANT_CONTENTS
 
#define DETACH_CONTENTS
 
#define RENEW_VARIANT_DATA
 

Macro Definition Documentation

◆ CMP_EQUAL

#define CMP_EQUAL   0

Referenced by KviKvsVariant::compare().

◆ CMP_OTHERGREATER

#define CMP_OTHERGREATER   1

Referenced by KviKvsVariant::compare().

◆ CMP_THISGREATER

#define CMP_THISGREATER   -1

Referenced by KviKvsVariant::compare().

◆ DELETE_VARIANT_CONTENTS

#define DELETE_VARIANT_CONTENTS
Value:
switch(m_pData->m_eType) \
{ \
delete m_pData->m_u.pArray; \
break; \
delete m_pData->m_u.pHash; \
break; \
delete m_pData->m_u.pString; \
break; \
delete m_pData->m_u.pReal; \
break; \
default: /* make gcc happy */ \
break; \
}
@ Array
Definition KviKvsVariant.h:127
@ String
Definition KviKvsVariant.h:124
@ Real
Definition KviKvsVariant.h:126
@ Hash
Definition KviKvsVariant.h:128

Referenced by KviKvsVariant::setNothing().

◆ DETACH_CONTENTS

#define DETACH_CONTENTS
Value:
if(m_pData) \
{ \
if(m_pData->m_uRefs <= 1) \
{ \
DELETE_VARIANT_CONTENTS \
delete m_pData; \
} \
else \
{ \
m_pData->m_uRefs--; \
} \
}

Referenced by KviKvsVariant::copyFrom(), KviKvsVariant::copyFrom(), KviKvsVariant::takeFrom(), KviKvsVariant::takeFrom(), and KviKvsVariant::~KviKvsVariant().

◆ RENEW_VARIANT_DATA

#define RENEW_VARIANT_DATA
Value:
if(m_pData) \
{ \
if(m_pData->m_uRefs > 1) \
{ \
m_pData->m_uRefs--; \
m_pData = new KviKvsVariantData; \
m_pData->m_uRefs = 1; \
} \
else \
{ \
} \
} \
else \
{ \
m_pData = new KviKvsVariantData; \
m_pData->m_uRefs = 1; \
}
#define DELETE_VARIANT_CONTENTS
Definition KviKvsVariant.cpp:339
The class which holds the type of the variant data.
Definition KviKvsVariant.h:115
unsigned int m_uRefs
Definition KviKvsVariant.h:149

Referenced by KviKvsVariant::setArray(), KviKvsVariant::setBoolean(), KviKvsVariant::setHash(), KviKvsVariant::setHObject(), KviKvsVariant::setInteger(), KviKvsVariant::setReal(), KviKvsVariant::setReal(), KviKvsVariant::setString(), and KviKvsVariant::setString().