Oracle Coherence for C++ API
Release 3.7.1.0

E22845-01

ThreadGate::GateBlock Class Reference

#include <coherence/util/ThreadGate.hpp>

List of all members.


Detailed Description

The EnterBlock class allows for easy creation of ThreadGate::enter code.

The EnterBlock object will ensure that the gate is entered and exited as a part of starting and ending the code block. It's used by the COH_GATE_ENTER macro

 

Public Types

enum   BlockType
  The type of GateBlock that will be constructed.

Public Member Functions

  GateBlock (BlockType nType, ThreadGate::Handle hGate, int64_t lTime)
  Construct a new EnterBlock object entering the supplied gate.
  GateBlock (const GateBlock &that)
  Copy constructor used by the COH_GATE_ENTERED macro.
  ~GateBlock ()
  Destroy an EnterBlock object, exiting the associated gate.
  operator bool () const
  Boolean conversion for the COH_GATE_ENTER macro.

Protected Attributes

ThreadGate::Handle  m_hGate
  Gate used by the EnterBlock.
BlockType  m_nType
  The operation requested when the GateBlock is entered.

Constructor & Destructor Documentation

GateBlock ( BlockType  nType,
    ThreadGate::Handle  hGate,
    int64_t  lTime  
  )      

Construct a new EnterBlock object entering the supplied gate.

Parameters:
  nType  the type of GateBlock to construct
  hGate  the gate to enter
  lTime  maximum number of milliseconds to wait; pass infinite for forever or immediate for no wait

GateBlock ( const GateBlock that  )   

Copy constructor used by the COH_GATE_ENTERED macro.

The new block takes over ownership of the gate.


Member Function Documentation

operator bool (    )  const

Boolean conversion for the COH_GATE_ENTER macro.

Returns:
true always
Exceptions:
  IllegalStateException  if the gate is null

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

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