Into

Modules

Documentation

classPiiMetaObject

#include <PiiMetaObject.h>

Meta objects store information specific to a certain data type.

Description

Class meta information contains a unique class name and a version number. The tracking flag is an application-wide static constant and not included in the meta object (see PiiSerializationTraits::Tracking).

Constructors and destructor

(
  • const char * className
  • unsigned int version
  • bool storeClassInfo
)

Create a new meta object with the given class name and version number.

Public member functions

const char *
( )

Get the name of the class this meta object represents.

bool

See if the class information (only version number, currently) needs to be stored.

unsigned int
( )

Get the current version number of the class.

template<class T>
(
  • const T &
)

Create a default PiiMetaObject instance for the type given as a parameter.

const PiiMetaObject *
(
  • const void *
)

Default implementation of the meta object getter function.

template<class T>
(
  • const T & obj
)

Get a meta object for the given object.

Function details

  • PiiMetaObject

    (
    • const char * className
    • unsigned int version
    • bool storeClassInfo
    )
    [inline]

    Create a new meta object with the given class name and version number.

    The storeClassInfo flag determines whether the version number is saved or not.

  • const char * className

    ()
    [inline]

    Get the name of the class this meta object represents.

  • bool isClassInfoStored

    ()
    [inline]

    See if the class information (only version number, currently) needs to be stored.

  • unsigned int version

    ()
    [inline]

    Get the current version number of the class.

  • template<class T>

    PiiMetaObject defaultMetaObject

    (
    • const T &
    )
    [inline]

    Create a default PiiMetaObject instance for the type given as a parameter.

    Returns

    a meta object that takes class information from PiiSerializationTraits.

  • const PiiMetaObject * metaObjectPointer

    (
    • const void *
    )
    [inline]

    Default implementation of the meta object getter function.

    This function returns a null pointer. If a serializable type has a non-default meta object getter (such as a virtual function), one needs to provide an overloaded version of this function.

  • template<class T>

    PiiMetaObject piiMetaObject

    (
    • const T & obj
    )
    [inline]

    Get a meta object for the given object.

    This function calls the metaObjectPointer() function, which needs to be overloaded if a serializable type needs a non-default meta object.

    See also
    • PII_SERIALIZATION_VIRTUAL_METAOBJECT

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.