Dacons LLP Mailit for C/C++ Version 1.0.8

EmaiObject.h File Reference

Basic library objects. More...

#include <EmaiTypes.h>
#include <EmaiErrors.h>

Go to the source code of this file.

Typedefs

typedef void * EmaiObject
 Base class for all Emai objects such as EmaiMessage, EmaiPop3Session, etc. All library objects can be passed to the functions, which accept EmaiObject as parameter.

Functions

 EmaiObjectAddRef (EmaiObject inObject)
 Increments reference count value of the object by 1.
 EmaiObjectRelease (EmaiObject inObject)
 Decreases reference count value of the object by 1. If reference count become zero the object is destroyed and memory occupied by the object is freed This function returns EmaiErrIncorrectParameter error if caller trys to destroy (set reference count to zero) message part objects which are owned by message object.
 EmaiObjectGetRefCount (EmaiObject inObject, EmaiUint32 *outRefCount)
 Returns reference count value of the object.
 EmaiObjectSetUserData (EmaiObject inObject, EmaiUint32 inKey, const void *inData, EmaiUint32 inDataSize)
 Allows to save user data to library object.
 EmaiObjectGetUserData (EmaiObject inObject, EmaiUint32 inKey, void *outData, EmaiUint32 *ioDataSize)
 Allows to retrieve user data from library object stored in object earlier using EmaiObjectSetUserData.
 EmaiRegisterLibrary (EmaiConstUniCharPtr inLicenseCode)
 Registers library.


Detailed Description

Basic library objects.

Version:
Mailit for C/C++ 1.0
Author:
(C) 2008 Dacons LLP.

Definition in file EmaiObject.h.


Function Documentation

EmaiObjectAddRef ( EmaiObject  inObject  ) 

Increments reference count value of the object by 1.

Parameters:
inObject - object which reference count value should be changed
Returns:
Result code (See EmaiEnumResultCodes)

Referenced by Emai::Object< ObjectType >::AddRef(), Emai::Object< ObjectType >::Object(), and Emai::Object< ObjectType >::operator=().

EmaiObjectGetRefCount ( EmaiObject  inObject,
EmaiUint32 *  outRefCount 
)

Returns reference count value of the object.

Parameters:
inObject - object to be examined
outRefCount - on successful function exit contains reference count value of the object
Returns:
Result code (See EmaiEnumResultCodes)

Referenced by Emai::Object< ObjectType >::RefCount().

EmaiObjectGetUserData ( EmaiObject  inObject,
EmaiUint32  inKey,
void *  outData,
EmaiUint32 *  ioDataSize 
)

Allows to retrieve user data from library object stored in object earlier using EmaiObjectSetUserData.

Parameters:
inObject - object to be examined
inKey - key used to identify the data
outData - pointer to memory where retrieved data should be stored. If NULL ioDataSize contains size of the data stored under key inKey
ioDataSize - size of the outData block in bytes, on exit contains size of the data copied in outData (if non-NULL) or size of the data (if outData is NULL)
Returns:
Result code (See EmaiEnumResultCodes)
Parameters:
outData  can be NULL

Referenced by Emai::Object< ObjectType >::GetUserData().

EmaiObjectRelease ( EmaiObject  inObject  ) 

Decreases reference count value of the object by 1. If reference count become zero the object is destroyed and memory occupied by the object is freed This function returns EmaiErrIncorrectParameter error if caller trys to destroy (set reference count to zero) message part objects which are owned by message object.

Parameters:
inObject - object which reference count value should be changed
Returns:
Result code (See EmaiEnumResultCodes)

Referenced by Emai::Object< ObjectType >::Release().

EmaiObjectSetUserData ( EmaiObject  inObject,
EmaiUint32  inKey,
const void *  inData,
EmaiUint32  inDataSize 
)

Allows to save user data to library object.

Parameters:
inObject - object to be modified
inKey - key used to identify the data
inData - pointer to data to be copied into object. If inData is NULL the function will remove data from the object, inDataSize value is ignored in this case
inDataSize - size of the data in bytes
Returns:
Result code (See EmaiEnumResultCodes)

Referenced by Emai::Object< ObjectType >::SetUserData().

EmaiRegisterLibrary ( EmaiConstUniCharPtr  inLicenseCode  ) 

Registers library.

Parameters:
inLicenseCode - license code
Returns:
Result code (See EmaiEnumResultCodes)