Oracle Coherence for C++ API
Release 3.6.1.0
E18813-01

- Main Page
- Namespaces
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Evolvable Class Reference

`#include <coherence/io/Evolvable.hpp>`

Inherits Object.

Inherited by AbstractEvolvable`[virtual]`, and EvolvablePortableObject`[virtual]`.

List of all members.

## Detailed Description

The Evolvable interface is implemented by classes that require forwards- and backwards-compatibility of their serialized form.

An Evolvable class has an integer version identifier `n`, where `n >= 0`. When the contents and/or semantics of the serialized form of the Evolvable class changes, the version identifier is increased. Two versions identifiers, `n1` and `n2`, indicate the same version iff `n1 == n2`; the version indicated by `n2` is newer than the version indicated by `n1` iff `n2 > n1`.

The Evolvable interface is designed to support the evolution of classes by the addition of data. Removal of data cannot be safely accomplished as long as a previous version of the class exists that relies on that data. Modifications to the structure or semantics of data from previous versions likewise cannot be safely accomplished as long as a previous version of the class exists that relies on the previous structure or semantics of the data.

When an Evolvable is deserialized, it retains any unknown data that has been added to newer versions of the class, and the version identifier for that data format. When the Evolvable is subsequently serialized, it includes both that version identifier and the unknown future data.

When an Evolvable is deserialized from a data stream whose version identifier indicates an older version, it must default and/or calculate the values for any data fields and properties that have been added since that older version. When the Evolvable is subsequently serialized, it includes its own version identifier and all of its data. Note that there will be no unknown future data in this case; future data can only exist when the version of the data stream is newer than the version of the Evolvable class.

Author:
  jh 2008.01.08

## Public Types
typedef spec::Handle | Handle
| Evolvable Handle definition.
typedef spec::View | View
| Evolvable View definition.
typedef spec::Holder | Holder
| Evolvable Holder definition.
## Public Member Functions
virtual int32_t | getImplVersion () const =0
| Determine the serialization version supported by the implementing class.
virtual int32_t | getDataVersion () const =0
| Obtain the version associated with the data stream from which this Evolvable was deserialized.
virtual void | setDataVersion (int32_t nVersion)=0
| Set the version associated with the data stream with which this Evolvable is being deserialized.
virtual Binary::View | getFutureData () const =0
| Return all the unknown remainder of the data stream from which this Evolvable was deserialized.
virtual void | setFutureData (Binary::View vBinFuture)=0
| Store the unknown remainder of the data stream from which this Evolvable is being deserialized.

## Member Function Documentation

virtual int32_t getImplVersion | ( |  | ) | const`[pure virtual]`

Determine the serialization version supported by the implementing class.

Returns:
  the serialization version supported by this Evolvable

Implemented in AbstractEvolvable.

virtual int32_t getDataVersion | ( |  | ) | const`[pure virtual]`

Obtain the version associated with the data stream from which this Evolvable was deserialized.

If the Object was constructed (not deserialized), the data version is the same as the implementation version.

Returns:
  the version of the data used to initialize this Evolvable, greater than or equal to zero

Implemented in AbstractEvolvable.

virtual void setDataVersion | ( | int32_t | nVersion | ) | `[pure virtual]`

Set the version associated with the data stream with which this Evolvable is being deserialized.

Parameters:

  | nVersion | the version of the data in the data stream that will be used to deserialize this Object; greater than or equal to zero

Implemented in AbstractEvolvable.

virtual Binary::View getFutureData | ( |  | ) | const`[pure virtual]`

Return all the unknown remainder of the data stream from which this Evolvable was deserialized.

The remainder is unknown because it is data that was originally written by a future version of this Evolvable's class.

Returns:
  future data in binary form

Implemented in AbstractEvolvable.

virtual void setFutureData | ( | Binary::View | vBinFuture | ) | `[pure virtual]`

Store the unknown remainder of the data stream from which this Evolvable is being deserialized.

The remainder is unknown because it is data that was originally written by a future version of this Evolvable's class.

Parameters:

  | vBinFuture | future data in binary form

Implemented in AbstractEvolvable.

The documentation for this class was generated from the following file:

- coherence/io/Evolvable.hpp

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.