Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

PofExtractor Class Reference

#include <coherence/util/extractor/PofExtractor.hpp>

Inherits AbstractExtractor, and PortableObject.

List of all members.


Detailed Description

POF-based ValueExtractor implementation.

PofExtractor takes advantage of POF's indexed state to extract part of an object without needing to deserialize the entire object.

POF uses a compact form in the serialized value when possible. For example, some numeric values are represented as special POF intrinsic types in which the type implies the value. As a result, POF requires the receiver of a value to have implicit knowledge of the type. PofExtractor uses the type supplied in the constructor as the source of the type information. If the type is void, PofExtractor will infer the type from the serialized state. See PofConstants for the list of the POF types.

In C++ the type is expressed by type_info which is obtained from the typeid operator.

Example where extracted value is float64_t:


     ValueExtractor::Handle hExtractor =
         PofExtractor::create(typeid(float64_t), 0);
 

Example where extracted value should be inferred from the serialized state:


     ValueExtractor::Handle hExtractor =
         PofExtractor::create(typeid(void), 0);
 

Author:
as/gm 2009.04.02
Since:
Coherence 3.5

Public Types

typedef spec::Handle Handle
 PofExtractor Handle definition.
typedef spec::View View
 PofExtractor View definition.
typedef spec::Holder Holder
 PofExtractor Holder definition.

Public Member Functions

virtual Object::Holder extractFromEntry (Map::Entry::Holder ohEntry) const
 Extract the value from the passed Entry object.
virtual void readExternal (PofReader::Handle hIn)
 
virtual void writeExternal (PofWriter::Handle hOut) const
 
virtual bool equals (Object::View v) const
 Compare the PofExtractor with another object to determine equality.
virtual size32_t hashCode () const
 Determine a hash value for the PofExtractor object according to the general Object#hashCode() contract.
virtual void toStream (std::ostream &out) const
 Return a human-readable description for this PofExtractor.
Class::View getClassExtracted () const
 Obtain the Class of the extracted value.
virtual
PofNavigator::View 
getNavigator () const
 Obtain the PofPath for this extractor.

Protected Member Functions

 PofExtractor ()
 Default constructor (necessary for the PortableObject interface).
 PofExtractor (const std::type_info &info, int32_t iProp)
 Constructs a PofExtractor based on a property index.
 PofExtractor (const std::type_info &info, PofNavigator::View vNavigator, int32_t nTarget=value)
 Constructs a PofExtractor based on a property path and the entry extraction target.
virtual int32_t getPofTypeId (PofContext::View vCtx) const
 Compute the expected POF type id based on the class.

Constructor & Destructor Documentation

PofExtractor ( const std::type_info &  info,
int32_t  iProp 
) [protected]

Constructs a PofExtractor based on a property index.

This constructor is equivalent to:

   PofExtractor::View vExtractor =
       PofExtractor::create(info, SimplePofPath::create(iProp), value);
 

Parameters:
info the required type of the extracted value or void if the type is to be inferred from the serialized state
iProp property index

PofExtractor ( const std::type_info &  info,
PofNavigator::View  vNavigator,
int32_t  nTarget = value 
) [protected]

Constructs a PofExtractor based on a property path and the entry extraction target.

Parameters:
info the required type of the extracted value or void if the type is to be inferred from the serialized state
vNavigator POF navigator
nTarget one of the value or key values


Member Function Documentation

virtual Object::Holder extractFromEntry ( Map::Entry::Holder  ohEntry  )  const [virtual]

Extract the value from the passed Entry object.

The returned value should follow the conventions outlined in the extract method.

This method will always throw a UnsupportedOperationException if called directly by the C++ client application, as its execution is only meaningful within the cluster.

It is expected that this extractor will only be used against POF-encoded binary entries within a remote partitioned cache.

Parameters:
entry an Entry object to extract a desired value from
Exceptions:
UnsupportedOperationException always, as it is expected that this extractor will only be executed within the cluster.
Returns:
the extracted value

Reimplemented from AbstractExtractor.

virtual bool equals ( Object::View  v  )  const [virtual]

Compare the PofExtractor with another object to determine equality.

Two PofExtractor objects are considered equal iff their paths are equal and they have the same target (key or value).

Returns:
true iff this PofExtractor and the passed object are equivalent

virtual size32_t hashCode (  )  const [virtual]

Determine a hash value for the PofExtractor object according to the general Object#hashCode() contract.

Returns:
an integer hash value for this PofExtractor object

Reimplemented from Object.

virtual void toStream ( std::ostream &  out  )  const [virtual]

Return a human-readable description for this PofExtractor.

Returns:
a String description of the PofExtractor

Reimplemented from Object.

Class::View getClassExtracted (  )  const

Obtain the Class of the extracted value.

Returns:
the expected Class

virtual PofNavigator::View getNavigator (  )  const [virtual]

Obtain the PofPath for this extractor.

Returns:
the PofPath value

virtual int32_t getPofTypeId ( PofContext::View  vCtx  )  const [protected, virtual]

Compute the expected POF type id based on the class.

Parameters:
vCtx POF context
Returns:
POF type id or t_unknown if the class is NULL.


The documentation for this class was generated from the following file:
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.