Oracle Coherence for C++ API
Release 3.6.0.0

E15728-01

MemberView Class Template Reference

#include <coherence/lang/MemberView.hpp>

Inherits SmartMember.

Inherited by FinalView.

List of all members.


Detailed Description

template<class T>
class coherence::lang::MemberView< T >

MemberView is a thread-safe view intended for use as a data-member within Objects.

Note: In the rare case that a MemberView is declared via the mutable keyword, the MemberView must be informed of this fact by setting fMutable to true during construction.

Author:
mf 2008.01.09
See also:
MemberHandle

MemberHolder


Public Types

typedef T ValueType
 The type of the values the holder can reference.
typedef T::View ValueView
 The View type for the referenced Object.
typedef ValueView GetType
 Result type for a non-const get operation.

Public Member Functions

 MemberView (const Object &oGuardian)
 Construct a new MemberView referencing NULL via a handle.
 MemberView (const Object &oGuardian, const ValueView &that)
 Construct a new MemberView referencing specified Object.
 MemberView (const Object &oGuardian, const ValueView &that, bool fMutable)
 Construct a new MemberView referencing specified Object.
 ~MemberView ()
 Destroy the MemberView.
MemberViewoperator= (const ValueView &that)
 Assign the MemberView to reference another object.
MemberViewoperator= (const MemberView &that)
 Assign the MemberView to reference another object.
 operator ValueView () const
 Return a View to the referenced Object.
template<class PT>
 o () const
 Return a View to the referenced Object.
template<class PT>
 o () const
 Return a TypedHolder to the referenced Object.
ValueView operator-> () const
 Dereference the MemberView.
const T & operator * () const
 Dereference this handle, returning T&.

Protected Member Functions

virtual void onEscape (bool fEscaped) const
 Event called when the guarding Object's escape state changes.

Derived implementations of this method should include a delegation call to their super class onEscape() method, after they've done their own processing of the event.

Parameters:
fEscaped true if the object is being escaped, false if the object is being captured

void set (const TypedHolder< T > &that, SynchronizedMemberWriteBlock *pSync=NULL)
 Set the view to reference an Object via a View.
ValueView get (SynchronizedMemberReadBlock *pSync=NULL) const
 Return a View to the referenced Object.

Protected Attributes

const T * m_cpo
 The referenced Object.

Constructor & Destructor Documentation

MemberView ( const Object oGuardian  )  [inline]

Construct a new MemberView referencing NULL via a handle.

Parameters:
oGuardian the object that protects this member

MemberView ( const Object oGuardian,
const ValueView that 
) [inline]

Construct a new MemberView referencing specified Object.

Parameters:
oGuardian the object that protects this member
that the object to reference

MemberView ( const Object oGuardian,
const ValueView that,
bool  fMutable 
) [inline]

Construct a new MemberView referencing specified Object.

Parameters:
oGuardian the object that protects this member
that the object to reference
fMutable true if the object was declared as mutable


Member Function Documentation

MemberView& operator= ( const ValueView that  )  [inline]

Assign the MemberView to reference another object.

Parameters:
that the object to reference
Returns:
a reference to this MemberView

MemberView& operator= ( const MemberView< T > &  that  )  [inline]

Assign the MemberView to reference another object.

Parameters:
that the object to reference
Returns:
a reference to this MemberView

operator ValueView (  )  const [inline]

Return a View to the referenced Object.

Returns:
a View to the referenced Object

Reimplemented in FinalView, FinalView< coherence::util::TypedCollections::TypedMap::EntryConverter >, FinalView< coherence::io::pof::RawDate >, FinalView< coherence::util::Set >, FinalView< coherence::util::Converter >, FinalView< coherence::lang::String >, FinalView< coherence::lang::Array >, FinalView< coherence::io::pof::RawTime >, FinalView< coherence::util::Filter >, FinalView< coherence::lang::Array< int32_t > >, FinalView< coherence::io::AbstractReadBuffer >, FinalView< coherence::util::ConverterCollections::EntryConverter >, FinalView< coherence::io::pof::reflect::PofNavigator >, FinalView< coherence::net::Member >, FinalView< coherence::lang::Object >, FinalView< coherence::util::Map >, and FinalView< coherence::lang::Array< octet_t > >.

o (  )  const [inline]

Return a View to the referenced Object.

Returns:
a View to the referenced Object

Reimplemented in FinalView, FinalView, FinalView< coherence::util::TypedCollections::TypedMap::EntryConverter >, FinalView< coherence::util::TypedCollections::TypedMap::EntryConverter >, FinalView< coherence::io::pof::RawDate >, FinalView< coherence::io::pof::RawDate >, FinalView< coherence::util::Set >, FinalView< coherence::util::Set >, FinalView< coherence::util::Converter >, FinalView< coherence::util::Converter >, FinalView< coherence::lang::String >, FinalView< coherence::lang::String >, FinalView< coherence::lang::Array >, FinalView< coherence::lang::Array >, FinalView< coherence::io::pof::RawTime >, FinalView< coherence::io::pof::RawTime >, FinalView< coherence::util::Filter >, FinalView< coherence::util::Filter >, FinalView< coherence::lang::Array< int32_t > >, FinalView< coherence::lang::Array< int32_t > >, FinalView< coherence::io::AbstractReadBuffer >, FinalView< coherence::io::AbstractReadBuffer >, FinalView< coherence::util::ConverterCollections::EntryConverter >, FinalView< coherence::util::ConverterCollections::EntryConverter >, FinalView< coherence::io::pof::reflect::PofNavigator >, FinalView< coherence::io::pof::reflect::PofNavigator >, FinalView< coherence::net::Member >, FinalView< coherence::net::Member >, FinalView< coherence::lang::Object >, FinalView< coherence::lang::Object >, FinalView< coherence::util::Map >, FinalView< coherence::util::Map >, FinalView< coherence::lang::Array< octet_t > >, and FinalView< coherence::lang::Array< octet_t > >.

o (  )  const [inline]

Return a TypedHolder to the referenced Object.

Returns:
a TypedHolder to the referenced Object

Reimplemented in FinalView, FinalView, FinalView< coherence::util::TypedCollections::TypedMap::EntryConverter >, FinalView< coherence::util::TypedCollections::TypedMap::EntryConverter >, FinalView< coherence::io::pof::RawDate >, FinalView< coherence::io::pof::RawDate >, FinalView< coherence::util::Set >, FinalView< coherence::util::Set >, FinalView< coherence::util::Converter >, FinalView< coherence::util::Converter >, FinalView< coherence::lang::String >, FinalView< coherence::lang::String >, FinalView< coherence::lang::Array >, FinalView< coherence::lang::Array >, FinalView< coherence::io::pof::RawTime >, FinalView< coherence::io::pof::RawTime >, FinalView< coherence::util::Filter >, FinalView< coherence::util::Filter >, FinalView< coherence::lang::Array< int32_t > >, FinalView< coherence::lang::Array< int32_t > >, FinalView< coherence::io::AbstractReadBuffer >, FinalView< coherence::io::AbstractReadBuffer >, FinalView< coherence::util::ConverterCollections::EntryConverter >, FinalView< coherence::util::ConverterCollections::EntryConverter >, FinalView< coherence::io::pof::reflect::PofNavigator >, FinalView< coherence::io::pof::reflect::PofNavigator >, FinalView< coherence::net::Member >, FinalView< coherence::net::Member >, FinalView< coherence::lang::Object >, FinalView< coherence::lang::Object >, FinalView< coherence::util::Map >, FinalView< coherence::util::Map >, FinalView< coherence::lang::Array< octet_t > >, and FinalView< coherence::lang::Array< octet_t > >.

ValueView operator-> (  )  const [inline]

Dereference the MemberView.

Returns:
a const pointer to the referenced Object

Reimplemented in FinalView, FinalView< coherence::util::TypedCollections::TypedMap::EntryConverter >, FinalView< coherence::io::pof::RawDate >, FinalView< coherence::util::Set >, FinalView< coherence::util::Converter >, FinalView< coherence::lang::String >, FinalView< coherence::lang::Array >, FinalView< coherence::io::pof::RawTime >, FinalView< coherence::util::Filter >, FinalView< coherence::lang::Array< int32_t > >, FinalView< coherence::io::AbstractReadBuffer >, FinalView< coherence::util::ConverterCollections::EntryConverter >, FinalView< coherence::io::pof::reflect::PofNavigator >, FinalView< coherence::net::Member >, FinalView< coherence::lang::Object >, FinalView< coherence::util::Map >, and FinalView< coherence::lang::Array< octet_t > >.

const T& operator * (  )  const [inline]

Dereference this handle, returning T&.

Returns:
a raw T& reference to the referenced Object
Exceptions:
NullPointerException if the this handle is NULL

void set ( const TypedHolder< T > &  that,
SynchronizedMemberWriteBlock pSync = NULL 
) [inline, protected]

Set the view to reference an Object via a View.

Parameters:
that the Object to reference
pSync optional external SyncornizedMemberWriteBlock to use to avoid internal synchronization.

ValueView get ( SynchronizedMemberReadBlock pSync = NULL  )  const [inline, protected]

Return a View to the referenced Object.

Parameters:
pSync optional external SyncornizedMemberReadBlock to use to avoid internal synchronization.
Returns:
a View to the referenced Object


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