*/
extern int
ORTETypeRegisterAdd(ORTEDomain *d,const char *typeName,ORTETypeSerialize ts,
- ORTETypeDeserialize ds,ORTETypeGetMaxSize gms,unsigned int ms);
+ ORTETypeDeserialize ds,ORTETypeGetMaxSize gms,
+ unsigned int ms,ORTETypeProcessEndianness pe,void *pep);
/**
* ORTETypeRegisterDestroyAll - destroy all registered data types
* @d: domain object handle
typedef int (*ORTETypeGetMaxSize)(ORTEGetMaxSizeParam *gms, int num);
+typedef void (*ORTETypeProcessEndianness)(CDR_Codec *cdrCodec, void *param);
+
/**
* struct ORTETypeRegister - registered data type
* @typeName: name of data type
* @deserialize: pointer to deserialization function
* @getMaxSize: pointer to function given maximal data length
* @maxSize: maximal size of ser./deser. data
+ * @processEndianness: allows application to adjust some preferences according to byte order
+ * @processParam: pointer to user structure containing parameters for processEndianness
*
* Contains description of registered data type. See @ORTETypeRegisterAdd function for details.
*/
typedef struct ORTETypeRegister {
- const char *typeName;
- ORTETypeSerialize serialize;
- ORTETypeDeserialize deserialize;
- ORTETypeGetMaxSize getMaxSize;
- unsigned int maxSize;
+ const char *typeName;
+ ORTETypeSerialize serialize;
+ ORTETypeDeserialize deserialize;
+ ORTETypeGetMaxSize getMaxSize;
+ unsigned int maxSize;
+ ORTETypeProcessEndianness processEndianness;
+ void *processParam;
} ORTETypeRegister;
/**
/*****************************************************************************/
int
ORTETypeRegisterAdd(ORTEDomain *d,const char *typeName,ORTETypeSerialize ts,
- ORTETypeDeserialize ds,ORTETypeGetMaxSize gms,unsigned int ms) {
+ ORTETypeDeserialize ds,ORTETypeGetMaxSize gms,
+ unsigned int ms,ORTETypeProcessEndianness pe,void *pep) {
TypeNode *tn;
if (!d)
tn->typeRegister.deserialize=ds;
tn->typeRegister.getMaxSize=gms;
tn->typeRegister.maxSize=ms;
+ tn->typeRegister.processEndianness=pe;
+ tn->typeRegister.processParam=pep;
pthread_rwlock_unlock(&d->typeEntry.lock);
debug(26,3) ("ORTETypeRegisterAdd: registered type:%s\n",typeName);
return ORTE_OK;
memcpy(objectEntryOID->instance,
csChange->cdrCodec.buffer,
max_size);
+ if(cstRemoteWriter->cstReader->typeRegister->processEndianness) {
+ cstRemoteWriter->cstReader->typeRegister->processEndianness(
+ &csChange->cdrCodec,
+ cstRemoteWriter->cstReader->typeRegister->processParam);
+ }
}
info.status=NEW_DATA;
info.topic=(char*)sp->topic;