10#ifndef __RTObject_class_h__
11#define __RTObject_class_h__ included
17#ifndef __RTFieldOffset_h__
18#include <RTFieldOffset.h>
21#ifndef __RTVersionId_h__
22#include <RTVersionId.h>
28typedef void * ( * RTSuperAccessFunction )(
void * derived );
35 const void * source );
81 RTS_INLINE
const char *
name (
void )
const;
87 RTS_INLINE RTVersionId
version(
void )
const;
104 RTS_INLINE
void init(
void * data)
const;
110 RTS_INLINE
void copy(
void * to,
const void * from)
const;
116 RTS_INLINE
void move(
void * to,
void * from)
const;
144 void destroy(
void * inst, DestroyOption opt)
const;
157 void install(
bool warnForDuplicates =
true )
const;
231 extern void RTnop_copy(
const RTObject_class *,
void *,
const void * );
237 extern void RTstruct_copy(
const RTObject_class *,
void *,
const void * );
276 extern void RTarray_copy(
const RTObject_class *,
void *,
const void * );
291 extern void RTabstract_copy(
const RTObject_class *,
void *,
const void * );
292 extern void RTabstract_move(
const RTObject_class *,
void *,
void * );
301#if RTUseFloatingPoint
316 typedef char * RTpchar;
317 typedef void * RTpvoid;
318 typedef unsigned char RTuchar;
319 typedef unsigned long RTulong;
320 typedef unsigned short RTushort;
329 template <>
inline const RTObject_class* RTObject_class::fromType<int>() {
return &RTType_int; }
330 template <>
inline const RTObject_class* RTObject_class::fromType<char>() {
return &RTType_char; }
331 template <>
inline const RTObject_class* RTObject_class::fromType<float>() {
return &RTType_float; }
332 template <>
inline const RTObject_class* RTObject_class::fromType<bool>() {
return &RTType_bool; }
333 template <>
inline const RTObject_class* RTObject_class::fromType<double>() {
return &RTType_double; }
334 template <>
inline const RTObject_class* RTObject_class::fromType<short>() {
return &RTType_short; }
335 template <>
inline const RTObject_class* RTObject_class::fromType<long>() {
return &RTType_long; }
336 template <>
inline const RTObject_class* RTObject_class::fromType<long long>() {
return &RTType_longlong; }
337 template <>
inline const RTObject_class* RTObject_class::fromType<unsigned int>() {
return &RTType_unsignedint; }
338 template <>
inline const RTObject_class* RTObject_class::fromType<unsigned char>() {
return &RTType_unsignedchar; }
339 template <>
inline const RTObject_class* RTObject_class::fromType<unsigned long>() {
return &RTType_unsignedlong; }
340 template <>
inline const RTObject_class* RTObject_class::fromType<unsigned long long>() {
return &RTType_unsignedlonglong; }
341 template <>
inline const RTObject_class* RTObject_class::fromType<unsigned short>() {
return &RTType_unsignedshort; }
342 template <>
inline const RTObject_class* RTObject_class::fromType<char*>() {
return &RTType_RTpchar; }
351 static void installAll(
void );
365#include <RTObject_class.inl>
Definition: RTDecoding.h:27
Definition: RTEncoding.h:27
Definition: RTObject_class.h:347
Definition: RTFieldDescriptor.h:40
A type descriptor providing information about a type.
Definition: RTObject_class.h:64
RTEncodeFunction _encode_func
The encode function of the type.
Definition: RTObject_class.h:211
RTInitFunction _init_func
The init function of the type, i.e.
Definition: RTObject_class.h:194
int encode(const void *data, RTEncoding *encoder) const
Encode an instance of the described type into an external representation (e.g.
Definition: RTObject_class.inl:64
RTDestroyFunction _destroy_func
The destroy function of the type, i.e.
Definition: RTObject_class.h:215
RTMoveFunction _move_func
The move function of the type, i.e.
Definition: RTObject_class.h:200
int _num_fields
This variable is used for structured and array-like types to specify the number of fields or elements...
Definition: RTObject_class.h:220
void destroy(void *inst, DestroyOption opt) const
Destroy an instance of the described type.
void copy(void *to, const void *from) const
Make a copy of an instance of the described type.
Definition: RTObject_class.inl:41
int isKindOf(const RTObject_class *other) const
Determines if the described type is the same, or a subtype of, another type.
void install(bool warnForDuplicates=true) const
Register the type descriptor so it can be looked up quickly using the name of the described type as t...
void move(void *to, void *from) const
Move an instance of the described type.
Definition: RTObject_class.inl:46
const RTObject_class * _super
The super type from which the type inherits.
Definition: RTObject_class.h:177
const RTObject_class * super(void) const
Get the descriptor for the super type, i.e.
Definition: RTObject_class.inl:21
void init(void *data) const
Initialize an instance of the described type.
Definition: RTObject_class.inl:36
const char * name(void) const
Get the name of the described type.
Definition: RTObject_class.inl:26
RTDecodeFunction _decode_func
The decode function of the type.
Definition: RTObject_class.h:206
void * allocate(void) const
Allocate new memory for holding an instance of the described type.
RTVersionId _version
The version id of the type.
Definition: RTObject_class.h:186
RTVersionId version(void) const
Get the version of the described type.
Definition: RTObject_class.inl:31
RTFieldOffset _size
The size (in bytes) of the type.
Definition: RTObject_class.h:189
RTCopyFunction _copy_func
The copy function of the type, i.e.
Definition: RTObject_class.h:197
const RTFieldDescriptor * _fields
This variable is used for structured and array-like types to specify the type of fields or elements t...
Definition: RTObject_class.h:226
int decode(void *data, RTDecoding *decoder) const
Decode an external representation (e.g.
Definition: RTObject_class.inl:56
RTSuperAccessFunction _super_accessor
The super object accessor function for this type.
Definition: RTObject_class.h:180
static const RTObject_class * lookup(const char *className)
Lookup a type descriptor by the name of the type it describes.
static const RTObject_class * fromType()
Get a type descriptor from a type TYPE at compile-time.
Definition: RTObject_class.inl:72
const char * _name
The name of the type.
Definition: RTObject_class.h:183